<template>
  <div class="aqct300-table" v-loading="loading"
       element-loading-text="拼命加载中"
       element-loading-spinner="el-icon-loading"
       element-loading-background="rgba(0, 0, 0, 0.4)">
    <div class="aqct300-form">
      <el-form ref="elForm1" :model="formData" :rules="rules" size="mini" label-width="85px"
               label-position="left">
        <div class="op-area">
          <el-row :gutter="30" type="flex" justify="space-around">
            <el-col :span="24">
              <el-form-item size="mini">
                <div class="btn-area">
                  <el-button type="success" circle icon="el-icon-check" @click.native.stop="check"
                             :disabled="!isearch&&!iedit&&!iadd"></el-button>
                  <el-button type="info" circle icon="el-icon-close" @click="cancel"
                             :disabled="!isearch&&!iedit&&!iadd"></el-button>
<!--                  <el-button type="danger" circle icon="el-icon-delete" @click="deleteData"-->
<!--                             :disabled="isearch || dataList.length < 1 "></el-button>-->

                  <el-button type="primary" circle icon="el-icon-search" @click="openSearch"
                             :disabled="isearch || iadd || iedit">
                    <!--                  开启查询-->
                    <!--                  {{isearch}}-{{iedit}}-{{iadd}}-->
                  </el-button>
                  <!--                <el-button type="primary" icon="el-icon-search" @click="searchData">-->
                  <!--&lt;!&ndash;                  查询&ndash;&gt;-->
                  <!--                </el-button>-->
<!--                  <el-button type="primary" circle icon="el-icon-plus" @click="openAdd"-->
<!--                             :disabled="iadd || isearch || iedit">-->
<!--                    &lt;!&ndash;                  新增&ndash;&gt;-->
<!--                  </el-button>-->
                  <el-button type="primary" circle icon="el-icon-edit" @click="openUpdate"
                             :disabled="iedit || isearch || iadd || dataList.length < 1 || formData.qcbastus !== 'N'">
                    <!--                  修改-->
                  </el-button>
<!--                  {{iedit}}-{{isearch}}-{{iadd}}-{{dataList.length < 1}}-{{formData.qcbastus !== 'N' }}-->
                  <el-button type="primary" circle icon="el-icon-more" @click="showList">
                    <!--                  查看列表-->
                  </el-button>
                </div>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
        <div class="area-1">
          <el-row :gutter="10">
            <el-col :span="20">
              <el-row :gutter="10">
                <el-col :span="18">
                  <el-row type="flex" :gutter="15">
                    <el-col :span="8">
                      <el-form-item label="检验单号" prop="qcbadocno" >
                        <search-table title="检验单号"
                                      ref="ref-qcbadocno"
                                      :url="search.qcbadocno.url"
                                      :table-fields="search.qcbadocno.fields" allowCheck="1"
                                      :index="search.qcbadocno.index"
                                      :is-multi="isMulti"
                                      :is-disabled="!isearch && !iadd"
                                      :bind-key="formDataKey"
                                      @set-value="setValue">
                        </search-table>
<!--                        {{translate('qcbadocno',formData.qcbadocno)}}-->
                      </el-form-item>
                    </el-col>
                    <el-col :span="8">
                      <el-form-item label="单据日期" prop="qcbadocdt">
                        <el-date-picker v-model="qcbadocdtArr"
                                        v-if="isearch"
                                        format="yyyy-MM-dd"
                                        value-format="yyyy-MM-dd HH:mm:ss"
                                        type="daterange"
                                        range-separator="至"
                                        start-placeholder="开始日期"
                                        end-placeholder="结束日期"
                                        clearable
                                        :style="{width: '100%'}"
                                        :disabled="!isearch&&!iadd&&!iedit"
                                        :picker-options="rangePickerOptions"
                                        :default-time="['00:00:00', '23:59:59']">
                        </el-date-picker>
                        <el-date-picker
                          v-model="formData.qcbadocdt"
                          v-if="!isearch"
                          align="right"
                          type="date"
                          placeholder="选择日期"
                          format="yyyy-MM-dd"
                          value-format="yyyy-MM-dd"
                          clearable
                          :disabled="!isearch&&!iadd&&!iedit"
                          :picker-options="pickerOptions"
                          :style="{width:'100%'}">
                        </el-date-picker>
                      </el-form-item>
                      <!--                <el-form-item label="单据日期" prop="qcbadocdt" v-if="!isearch">-->
                      <!--                  -->
                      <!--                </el-form-item>-->
                    </el-col>
                    <el-col :span="8">
                      <el-col :span="18">
                        <el-form-item label="开单人员" prop="qcba900">
                          <search-table title="开单人员"
                            ref="ref-qcba900"
                            key="ref-qcba900"
                            :url="search.qcba900.url"
                            :table-fields="search.qcba900.fields" allowCheck="1"
                            :index="search.qcba900.index"
                            :is-multi="isMulti"
                            :is-disabled="!isearch&&!iadd&&!iedit"
                            :bind-key="formDataKey"
                            @set-value="setValue">
                          </search-table>
                        </el-form-item>
                      </el-col>
                      <el-col :span="6"><span class="desc-span"> {{ descSet.qcba900_desc }}</span></el-col>
                    </el-col>
                  </el-row>
                </el-col>

                <!--          <el-col :span="18">-->
                <!--            <el-row type="flex" justify="center" align="top" :gutter="15">-->
                <!--              <el-col :span="10">-->
                <!--                <el-form-item label-width="148px" label="质量异常申请单号" prop="qcba032">-->
                <!--                  <el-input v-model="formData.qcba032" placeholder="请输入质量异常申请单号" clearable-->
                <!--                            suffix-icon='el-icon-search' :style="{width: '100%'}"></el-input>-->
                <!--                </el-form-item>-->
                <!--              </el-col>-->
                <!--            </el-row>-->
                <!--          </el-col>-->
              </el-row>
              <el-row :gutter="10">
                <el-col :span="18">
                  <el-row type="flex" justify="end" :gutter="15">
                    <el-col :span="8">
                      <el-form-item label="检验类型" prop="qcba000">
                        <div style="display: block">
                          <!--                    popper-append-to-body="false"-->
                          <el-select clearable placeholder="请选择" v-model="formData.qcba000" @change="qcba000Chage"
                                     :disabled="!isearch&&!iadd&&!iedit"
                                     :style="{width: '50%'}">
                            <el-option
                              v-for="item in qcba000Options"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                            </el-option>
                          </el-select>
                          <!--                    {{isearch}}-{{iadd}}&#45;&#45;{{iedit}}-->
                          <el-select clearable placeholder="请选择" v-model="formData.qcba031"
                                     :disabled="qcba031Disabled || (!isearch&&!iadd&&!iedit)"
                                     @focus="qcba031Focus" :style="{width: '50%'}">
                            <el-option
                              v-for="item in qcba031Options"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                            </el-option>
                          </el-select>
                          <!--                    <el-select-->
                          <!--                      v-model="formData.qcba000"-->
                          <!--                      multiple-->
                          <!--                      width="300px"-->
                          <!--                      filterable-->
                          <!--                      remote-->
                          <!--                      reserve-keyword-->
                          <!--                      placeholder="请选择"-->
                          <!--                      @focus="getQcba000SelectList"-->
                          <!--                      :style="{width: '50%'}"-->
                          <!--                      :remote-method="getQcba000SelectList"-->
                          <!--                      :loading="qcba000Loading">-->
                          <!--                      <el-option-->
                          <!--                        v-for="item in qcba000Options"-->
                          <!--                        :key="item.value"-->
                          <!--                        :label="item.label"-->
                          <!--                        :value="item.value">-->
                          <!--                      </el-option>-->
                          <!--                    </el-select>-->
                          <!--                    <el-select-->
                          <!--                      v-model="formData.qcba000"-->
                          <!--                      multiple-->
                          <!--                      filterable-->
                          <!--                      remote-->
                          <!--                      reserve-keyword-->
                          <!--                      placeholder="请选择"-->
                          <!--                      @focus="getQcba031SelectList"-->
                          <!--                      :style="{width: '50%'}"-->
                          <!--                      :remote-method="getQcba031SelectList"-->
                          <!--                      :loading="qcba031Loading">-->
                          <!--                      <el-option-->
                          <!--                        v-for="item in qcba031Options"-->
                          <!--                        :key="item.value"-->
                          <!--                        :label="item.label"-->
                          <!--                        :value="item.value">-->
                          <!--                      </el-option>-->
                          <!--                    </el-select>-->
                        </div>

                      </el-form-item>
                    </el-col>
                    <el-col :span="8">
                      <el-col :span="18">
                        <el-form-item label="开单部门" prop="qcba901">
                          <search-table title="开单部门"
                                        ref="ref-qcba901"
                                        :url="search.qcba901.url"
                                        :table-fields="search.qcba901.fields" allowCheck="1"
                                        :index="search.qcba901.index"
                                        :is-multi="isMulti"
                                        :is-disabled="!isearch&&!iadd&&!iedit"
                                        :bind-key="formDataKey"
                                        @set-value="setValue">
                          </search-table>
                        </el-form-item>
                      </el-col>
                      <el-col :span="6"><span class="desc-span"> {{ descSet.qcba901_desc }}</span></el-col>
                    </el-col>
                  </el-row>
                </el-col>
              </el-row>
            </el-col>
            <el-col :span="4">
              <el-dropdown split-button size="medium" trigger="hover" type="primary" @command="handleStusClick">
                <span v-if="isearch && !stusTxt || !formData.qcbastus" v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></span>
                <span v-else-if="isearch && stusTxt">{{stusTxt}}</span>
                <span v-else-if="!isearch && formData.qcbastus === 'N'">未审核</span>
                <span v-else-if="!isearch && formData.qcbastus === 'Y'">已审核</span>
                <span v-else-if="!isearch && formData.qcbastus === 'X'">已作废</span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item v-if="isearch" command="N">未审核</el-dropdown-item>
                  <el-dropdown-item v-if="isearch" command="Y">已审核</el-dropdown-item>
                  <el-dropdown-item v-if="isearch" command="X">已作废</el-dropdown-item>
                  <el-dropdown-item v-if="isearch" command="clear" v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></el-dropdown-item>
                  <el-dropdown-item v-if="!isearch && formData.qcbastus === 'Y'" command="unConfirmed">取消审核</el-dropdown-item>
                  <el-dropdown-item v-if="!isearch && formData.qcbastus === 'N'" command="confirmed">审核</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
            </el-col>
          </el-row>
        </div>
        <div class="area-2">
          <el-tabs v-model="activeName" @tab-click="handleClickTab1" type="border-card">
            <el-tab-pane label="基本资料" name="tab-1-1">
              <el-row :gutter="10">
                <el-col :span="12">
                  <div class="tab-1-1-1">
                    <el-row :gutter="10">
                      <el-col :span="8">
                        <el-form-item label="来源单号" prop="qcba001">
                          <search-table title="来源单号"
                                        ref="ref-qcba001"
                                        :url="search.qcba001.url"
                                        :table-fields="search.qcba001.fields" allowCheck="1"
                                        :index="search.qcba001.index"
                                        :is-multi="isMulti"
                                        :is-disabled="!isearch&&!iadd&&!iedit"
                                        :bind-key="formDataKey"
                                        @set-value="setValue">

                          </search-table>
                        </el-form-item>
                      </el-col>
                      <el-col :span="8">
                        <el-form-item label="来源单项次" prop="qcba002">
                          <search-table title="来源单项次"
                                        ref="ref-qcba002"
                                        :url="search.qcba002.url"
                                        :table-fields="search.qcba002.fields" allowCheck="1"
                                        :index="search.qcba002.index"
                                        :is-multi="isMulti"
                                        :is-disabled="!isearch&&!iadd&&!iedit"
                                        :condition="search.qcba002.condition"
                                        @get-condition="getCondition"
                                        :bind-key="formDataKey"
                                        @set-value="setValue">
                          </search-table>
                        </el-form-item>
                      </el-col>
                      <el-col :span="8">
                        <el-form-item label="Runcard" prop="qcba029">
                          <el-input clearable type="text" :disabled="!isearch&&!iadd&&!iedit"
                                    v-model="formData.qcba029"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="10">
                      <el-col :span="8">
                        <el-form-item label="参考单号" prop="qcba003">
                          <el-input clearable type="text" :disabled="!isearch&&!iadd&&!iedit"
                                    v-model="formData.qcba003"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="8">
                        <el-form-item label="参考单项次" prop="qcba004">
                          <el-input clearable type="text" :disabled="!isearch&&!iadd&&!iedit"
                                    v-model="formData.qcba004"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="8">
                        <el-form-item label="客户订购单号" prop="khdgdh">
                          <el-input clearable type="text" disabled v-model="formData.khdgdh"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="10">
                      <el-col :span="8">
                        <el-form-item label="交易对象编号" prop="qcba005">
                          <search-table title="交易对象编号"
                                        ref="ref-qcba005"
                                        :url="search.qcba005.url"
                                        :table-fields="search.qcba005.fields" allowCheck="1"
                                        :index="search.qcba005.index"
                                        :is-multi="isMulti"
                                        :is-disabled="!isearch&&!iadd&&!iedit"
                                        :bind-key="formDataKey"
                                        @set-value="setValue">
                          </search-table>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="10">
                      <el-col :span="12">
                        <el-form-item label="供应商出厂检验记录" prop="qcbaud001" label-width="120px">
                          <el-select clearable placeholder="请选择" v-model="formData.qcbaud001"
                                     :disabled="!isearch&&!iadd&&!iedit"
                                     :style="{width: '100%'}">
                            <el-option
                              v-for="item in qcbaud001Options"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                            </el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="10">
                      <el-col :span="12">
                        <el-form-item label="供应商材质证明" prop="qcbaud002" label-width="120px">
                          <el-select clearable placeholder="请选择" v-model="formData.qcbaud002"
                                     :disabled="!isearch&&!iadd&&!iedit"
                                     :style="{width: '100%'}">
                            <el-option
                              v-for="item in qcbaud002Options"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                            </el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="10">
                      <el-col :span="8">
                        <el-form-item label="作业编号" prop="qcba006">
                          <search-table title="作业编号"
                                        ref="ref-qcba006"
                                        :url="search.qcba006.url"
                                        :table-fields="search.qcba006.fields" allowCheck="1"
                                        :index="search.qcba006.index"
                                        :is-multi="isMulti"
                                        :is-disabled="!isearch&&!iadd&&!iedit"
                                        :bind-key="formDataKey"
                                        @set-value="setValue">
                          </search-table>
                        </el-form-item>
                      </el-col>
                      <el-col :span="8">
                        <el-form-item label="作业序" prop="qcba007">
                          <el-input clearable type="text" :disabled="!isearch&&!iadd&&!iedit"
                                    v-model="formData.qcba007"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="10">
                      <el-col :span="8">
                        <el-form-item label="来源数量" prop="qcba008">
                          <el-input clearable type="number" :disabled="!isearch&&!iadd&&!iedit"
                                    v-model="formData.qcba008"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="8">
                        <el-form-item label="单位" prop="qcba009">
                          <search-table title="单位"
                                        ref="ref-qcba009"
                                        :url="search.qcba009.url"
                                        :table-fields="search.qcba009.fields" allowCheck="1"
                                        :index="search.qcba009.index"
                                        :is-multi="isMulti"
                                        :is-disabled="!isearch&&!iadd&&!iedit"
                                        :bind-key="formDataKey"
                                        @set-value="setValue">

                          </search-table>
                        </el-form-item>
                      </el-col>
                      <el-col :span="8">
                        <span class="desc-span">{{descSet.qcba009_desc}}</span>
                      </el-col>
                    </el-row>
                    <el-row :gutter="10">
                      <el-col :span="8">
                        <el-form-item label="送检量" prop="qcba017">
                          <el-input clearable type="number" :disabled="!isearch&&!iadd&&!iedit"
                                    v-model="formData.qcba017"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                  </div>
                </el-col>
                <el-col :span="12">
                  <div class="tab-1-1-2">
                    <el-row :gutter="10">
                      <el-col :span="12">
                        <el-form-item label="料件编号" prop="qcba010">
                          <search-table title="料件编号"
                                        ref="ref-qcba010"
                                        :url="search.qcba010.url"
                                        :table-fields="search.qcba010.fields" allowCheck="1"
                                        :index="search.qcba010.index"
                                        :is-multi="isMulti"
                                        :is-disabled="!isearch&&!iadd&&!iedit"
                                        :bind-key="formDataKey"
                                        @set-value="setValue">
                          </search-table>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="10">
                      <el-col :span="12">
                        <el-form-item label="品名" prop="qcba010_desc1">
                          <el-input clearable type="text" disabled v-model="formData.qcba010_desc1"
                                    title="formData.qcba010_desc1"></el-input>
                        </el-form-item>
                      </el-col>


                      <el-col :span="8">
                        <el-form-item label="图号" prop="imaa041">
                          <el-input clearable type="text" :disabled="!isearch&&!iadd&&!iedit" v-model="formData.imaa041"
                                    title="formData.qcba010_desc2"></el-input>
                        </el-form-item>
                      </el-col>

                    </el-row>
                    <el-row :gutter="10">
                      <el-col :span="12">
                        <el-form-item label="规格" prop="qcba010_desc2">
                          <el-input clearable type="text" disabled v-model="formData.qcba010_desc2"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="8">
                        <el-form-item label="批号" prop="qcba034">
                          <el-input clearable type="text" :disabled="!isearch&&!iadd&&!iedit"
                                    v-model="formData.qcba034"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="10">
                      <el-col :span="12">
                        <el-form-item label="品管分群" prop="qcba013">
                          <search-table title="品管分群"
                                        ref="ref-qcba013"
                                        :url="search.qcba013.url"
                                        :table-fields="search.qcba013.fields" allowCheck="1"
                                        :index="search.qcba013.index"
                                        :is-multi="isMulti"
                                        :is-disabled="!isearch&&!iadd&&!iedit"
                                        :bind-key="formDataKey"
                                        @set-value="setValue">
                          </search-table>
                        </el-form-item>
                      </el-col>
                      <el-col :span="8">
                        <el-form-item label="有效日期" prop="qcba035">
                          <el-date-picker v-model="qcba035Arr"
                                          v-if="isearch"
                                          format="yyyy-MM-dd"
                                          value-format="yyyy-MM-dd HH:mm:ss"
                                          type="daterange"
                                          range-separator="至"
                                          start-placeholder="开始日期"
                                          end-placeholder="结束日期"
                                          clearable
                                          :style="{width: '100%'}"
                                          :disabled="!isearch&&!iadd&&!iedit"
                                          :picker-options="rangePickerOptions"
                                          :default-time="['00:00:00', '23:59:59']">
                          </el-date-picker>

                          <el-date-picker
                            v-model="formData.qcba035"
                            v-if="!isearch"
                            align="right"
                            type="date"
                            placeholder="选择日期"
                            format="yyyy-MM-dd"
                            value-format="yyyy-MM-dd"
                            clearable
                            :disabled="!isearch&&!iadd&&!iedit"
                            :picker-options="pickerOptions"
                            :style="{width:'100%'}">
                          </el-date-picker>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="10">
                      <el-col :span="12">
                        <el-form-item label="承认文号" prop="qcba020">
                          <el-input clearable type="text" :disabled="!isearch&&!iadd&&!iedit"
                                    v-model="formData.qcba020"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row :gutter="10">
                      <el-col :span="12">
                        <el-form-item label="紧急度" prop="qcba021">
                          <el-select clearable placeholder="请选择" v-model="formData.qcba021"
                                     :disabled="!isearch&&!iadd&&!iedit"
                                     :style="{width: '100%'}">
                            <el-option
                              v-for="item in qcba021Options"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                            </el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                  </div>
                </el-col>
              </el-row>
              <el-row :gutter="10">
                <el-col :span="12">
                  <div class="tab-1-1-3">
                    <el-row :gutter="10">
                      <el-col :span="8">
                        <el-col :span="20">
                          <el-form-item label="检验员" prop="qcba024">
                            <search-table title="开单人员"
                                          ref="ref-qcba024"
                                          :url="search.qcba024.url"
                                          :table-fields="search.qcba024.fields" allowCheck="1"
                                          :index="search.qcba024.index"
                                          :is-multi="isMulti"
                                          :is-disabled="!isearch&&!iadd&&!iedit"
                                          :bind-key="formDataKey"
                                          @set-value="setValue">
                            </search-table>
                          </el-form-item>
                        </el-col>
                        <el-col :span="4">
                          <span class="desc-span">{{descSet.qcba024_desc}}</span>
                        </el-col>
                      </el-col>
                      <el-col :span="8">
                        <el-form-item label="检验单位" prop="qcba016">
                          <search-table title="检验单位"
                                        ref="ref-qcba016"
                                        :url="search.qcba016.url"
                                        :table-fields="search.qcba016.fields" allowCheck="1"
                                        :index="search.qcba016.index"
                                        :is-multi="isMulti"
                                        :is-disabled="!isearch&&!iadd&&!iedit"
                                        :bind-key="formDataKey"
                                        @set-value="setValue">
                          </search-table>
                        </el-form-item>
                      </el-col>
                      <el-col :span="8">
                        <span class="desc-span">{{descSet.qcba016_desc}}</span>
                      </el-col>
                    </el-row>
                    <el-row :gutter="10">
                      <el-col :span="8">
                        <el-col :span="24">
                          <el-form-item label="判定结果" prop="qcba022">
                            <el-select clearable placeholder="请选择" v-model="formData.qcba022"
                                       :disabled="!isearch&&!iadd&&!iedit"
                                       :style="{width: '100%'}">
                              <el-option
                                v-for="item in qcba022Options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                              </el-option>
                            </el-select>
                          </el-form-item>
                        </el-col>
                      </el-col>
                    </el-row>
                    <el-row :gutter="10">
                      <el-col :span="8">
                        <el-col :span="24">
                          <el-form-item label="实际重量" prop="qcbaud011">
                            <el-input type="number" :disabled="!isearch&&!iadd&&!iedit"
                                      v-model="formData.qcbaud011"></el-input>
                          </el-form-item>
                        </el-col>
                      </el-col>
                      <el-col :span="8">
                        <el-form-item label="重量单位" prop="qcbaud003">
                          <el-select clearable placeholder="请选择" v-model="formData.qcbaud003"
                                     :disabled="!isearch&&!iadd&&!iedit"
                                     :style="{width: '100%'}">
                            <el-option
                              v-for="item in qcbaud003Options"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                            </el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>
                  </div>
                </el-col>
                <el-col :span="12">
                  <div class="tab-1-1-4">
                    <el-row :gutter="10">
                      <el-col :span="8">
                        <el-form-item label="合格量" prop="qcba023">
                          <el-input clearable type="number" :disabled="!isearch&&!iadd&&!iedit"
                                    v-model="formData.qcba023"></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="8">
                        <el-form-item label="不良数" prop="qcba027">
                          <el-input clearable type="number" :disabled="!isearch&&!iadd&&!iedit"
                                    v-model="formData.qcba027"></el-input>
                        </el-form-item>
                      </el-col>
                    </el-row>
                  </div>
                </el-col>
              </el-row>
            </el-tab-pane>
<!--            <el-tab-pane label="相关资料" name="tab-1-2">相关资料</el-tab-pane>-->
            <el-tab-pane label="联产品与结果判定" name="tab-1-3">
              <div class="table-button" v-show="iedit">
                <el-button type="primary" size="mini" icon="el-icon-plus" circle
                           @click.prevent="addQcbc">
                </el-button>
              </div>
              <el-table size="mini" border v-table-fit :data="qcbcDataList" ref="list-table-qcbc" id="list-table-qcbc" height="387px"
                        @row-click="clickQcbcRow"
                        @row-dblclick="dbClickQcbcRow"
                        :row-class-name="tableRowClassNameQcbc" >
<!--                :key="editStus.qcbc"-->
                <el-table-column property="qcbcseq" label="行序"></el-table-column>
                <el-table-column property="qcbc001" label="类型" width="160px">
                  <template v-slot="scope">
                    <span v-show="!scope.row.qcbc001Edit">{{ translateByOptions(qcbc001Options, scope.row.qcbc001) }} </span>
                    <el-select placeholder="请选择" v-model="scope.row.qcbc001" v-show="scope.row.qcbc001Edit"
                               @change="changeQcbcRowData(scope.row, scope.$index,'qcbc001',true)"
                               @keyup.enter.native="changeQcbcRowData(scope.row,scope.$index, 'qcbc001',true)">
                      <el-option
                        v-for="item in qcbc001Options"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                      </el-option>
                    </el-select>
                  </template>
                </el-table-column>
                <el-table-column property="qcbc002" label="判定结果编号" width="200px">
                  <template v-slot="scope">
                    <span v-show="!scope.row.qcbc002Edit">{{scope.row.qcbc002}}</span>
                    <search-table title="判定结果编号"
                                  v-show="scope.row.qcbc002Edit"
                                  :ref="'ref-qcbc002-' + scope.$index"
                                  :url="search.qcbc002.url"
                                  :table-fields="search.qcbc002.fields"
                                  :index="search.qcbc002.index"
                                  :is-multi="isMulti"
                                  :bind-key="qcbcKey"
                                  :default-val="scope.row.qcbc002"
                                  :not-clearable="true"
                                  :id="'ref-qcbc002-' + scope.$index"
                                  @set-value="setValue"
                    ></search-table>
                  </template>
                </el-table-column>
                <el-table-column property="qcbc002_desc" label="说明">
                  <template v-slot="scope">
                    <span v-if="scope.row.qcbc002 === 'A001'">生产不良</span>
                    <span v-if="scope.row.qcbc002 === 'A002'">来料入库</span>
                    <span v-if="scope.row.qcbc002 === 'A003'">来料不良</span>
                    <span v-if="scope.row.qcbc002 === 'A004'">生产入库</span>
                  </template>
                </el-table-column>
                <el-table-column property="qcbc012" label="判定区分">
                  <template v-slot="scope">
                    <span v-if="scope.row.qcbc012 === '1'">1:良品</span>
                    <span v-if="scope.row.qcbc012 === '2'">2:不良品入库</span>
                    <span v-if="scope.row.qcbc012 === '3'">3:报废入库</span>
                    <span v-if="scope.row.qcbc012 === '4'">4:验退</span>
                    <span v-if="scope.row.qcbc012 === '5'">5:PQC破坏性检验下线</span>
                    <span v-if="scope.row.qcbc012 === '6'">6:转回当站在制</span>
                    <span v-if="scope.row.qcbc012 === '7'">7:转回当站报废</span>
                  </template>
                </el-table-column>
                <el-table-column property="qcbc013" label="处理方式">
                  <template v-slot="scope">
                    <span v-if="scope.row.qcbc013 === '1'">1:计价</span>
                    <span v-if="scope.row.qcbc013 === '2'">2:不计价</span>
                  </template>
                </el-table-column>
                <el-table-column property="qcbc003" label="料件编号"></el-table-column>
                <el-table-column property="qcbc003_desc1" label="品名"></el-table-column>
                <el-table-column property="qcbc003_desc2" label="规格"></el-table-column>
<!--                <el-table-column property="qcbc004" label="产品特征"></el-table-column>-->
<!--                <el-table-column property="qcbc004_desc" label="产品特征说明"></el-table-column>-->
                <el-table-column property="qcbc005" label="库位"  width="200px">
                  <template v-slot="scope">
                    <span v-show="!scope.row.qcbc005Edit">{{scope.row.qcbc005}}</span>
                    <search-table title="库位"
                                  :ref="'ref-qcbc005-'+ scope.$index"
                                  v-show="scope.row.qcbc005Edit"
                                  :url="search.qcbc005.url"
                                  :table-fields="search.qcbc005.fields"
                                  :index="search.qcbc005.index"
                                  :is-multi="isMulti"
                                  :bind-key="qcbcKey"
                                  :default-val="scope.row.qcbc005"
                                  :not-clearable="true"
                                  :id="'ref-qcbc005-' + scope.$index"
                                  @set-value="setValue"
                    ></search-table>
                  </template>
                </el-table-column>
                <el-table-column property="qcbc005_desc" label="库位名称"></el-table-column>
                <el-table-column property="qcbc006" label="储位" width="200px">
                  <template v-slot="scope">
                    <span v-show="!scope.row.qcbc006Edit">{{scope.row.qcbc006}}</span>
                    <search-table title="储位"
                                  :ref="'ref-qcbc006-'+ scope.$index"
                                  v-show="scope.row.qcbc006Edit"
                                  :url="search.qcbc006.url"
                                  :table-fields="search.qcbc006.fields"
                                  :index="search.qcbc006.index"
                                  :is-multi="isMulti"
                                  :bind-key="qcbcKey"
                                  :condition="search.qcbc006.condition"
                                  :default-val="scope.row.qcbc006"
                                  :not-clearable="true"
                                  :id="'ref-qcbc006-' + scope.$index"
                                  @get-condition="getCondition"
                                  @set-value="setValue"
                    ></search-table>
                  </template>
                </el-table-column>
                <el-table-column property="qcbc006_desc" label="储位名称"></el-table-column>
                <el-table-column property="qcbc007" label="批号" width="150px">
                  <template v-slot="scope">
                    <span v-show="!scope.row.qcbc007Edit">{{scope.row.qcbc007}}</span>
                    <el-input v-show="scope.row.qcbc007Edit"
                              v-model="scope.row.qcbc007"
                              type="text"
                              :id="'ref-qcbc007-' + scope.$index"
                              @blur="scope.row.qcbc007Edit=false"
                              @change="changeQcbcRowData(scope.row, scope.$index,'qcbc007',true)"
                              @keyup.enter.native="changeQcbcRowData(scope.row,scope.$index, 'qcbc007',true)"></el-input>
                  </template>
                </el-table-column>
                <el-table-column property="qcbc008" label="单位"></el-table-column>
                <el-table-column property="qcbc008_desc" label="说明"></el-table-column>
                <el-table-column property="qcbc009" label="判定数量" width="120px">
                  <template v-slot="scope">
                    <span v-show="!scope.row.qcbc009Edit">{{scope.row.qcbc009}}</span>
                    <el-input v-show="scope.row.qcbc009Edit"
                              v-model="scope.row.qcbc009"
                              type="number"
                              :id="'ref-qcbc009-' + scope.$index"
                              @change="changeQcbcRowData(scope.row, scope.$index,'qcbc009',true)"
                              @keyup.enter.native="changeQcbcRowData(scope.row,scope.$index, 'qcbc009',true)"></el-input>
                  </template>
                </el-table-column>
                <el-table-column property="qcbc010" label="已入库数"></el-table-column>
                <el-table-column property="qcbc011" label="库存备注" width="200px">
                  <template v-slot="scope">
                    <span v-show="!scope.row.qcbc011Edit">{{scope.row.qcbc011}}</span>
                    <el-input v-show="scope.row.qcbc011Edit"
                              v-model="scope.row.qcbc011"
                              type="text"
                              :id="'ref-qcbc011-' + scope.$index"
                              @change="changeQcbcRowData(scope.row, scope.$index,'qcbc011',true)"
                              @keyup.enter.native="changeQcbcRowData(scope.row,scope.$index, 'qcbc011',true)"></el-input>
                  </template>
                </el-table-column>
                <el-table-column
                  v-if="iedit"
                  fixed="right"
                  label="操作"
                  width="150">
                  <template v-slot="scope">
                    <!--                  <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>-->
                    <el-button type="primary" size="mini" icon="el-icon-edit" circle @click.prevent="editQcbc(scope.row,scope.$index)"></el-button>
                    <el-button type="danger" size="mini" icon="el-icon-delete" circle @click.prevent="deleteQcbc(scope.$index)"></el-button>
<!--                    <el-button type="primary" size="mini" icon="el-icon-plus" circle @click.prevent="addQcbc" v-if="scope.$index === qcbcDataList.length-1">-->
<!--                        &lt;!&ndash;                  新增&ndash;&gt;-->
<!--                      </el-button>-->
                  </template>
                </el-table-column>
              </el-table>
            </el-tab-pane>
<!--            <el-tab-pane label="备注" name="tab-1-4">备注</el-tab-pane>-->
            <el-tab-pane label="异动资讯" name="tab-1-5">
              <el-row :gutter="10">
                <el-col :span="12">
                  <el-card class="box-card" style="min-height: 380px">
                    <div slot="header" class="clearfix">
                      <span>资料归属</span>
<!--                      <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
                    </div>
                    <div class="text item">
                      <el-row :gutter="10">
                        <el-col :span="12">
                          <el-form-item label="资料所有者" prop="qcbaownid">
                            <search-table title="资料所有者"
                                          ref="ref-qcbaownid"
                                          :url="search.qcbaownid.url"
                                          :table-fields="search.qcbaownid.fields" allowCheck="1"
                                          :index="search.qcbaownid.index"
                                          :is-multi="isMulti"
                                          :is-disabled="!isearch && !iadd"
                                          :bind-key="formDataKey"
                                          @set-value="setValue">
                            </search-table>
                          </el-form-item>
                        </el-col>
                        <el-col :span="12">
                          <span class="desc-span"> {{descSet.qcbaownid_desc}}</span>
                        </el-col>
                      </el-row>
                      <el-row :gutter="10">
                        <el-col :span="12">
                          <el-form-item label="资料所有部门" prop="qcbaowndp">
                            <search-table title="资料所有部门"
                                          ref="ref-qcbaowndp"
                                          :url="search.qcbaowndp.url"
                                          :table-fields="search.qcbaowndp.fields" allowCheck="1"
                                          :index="search.qcbaowndp.index"
                                          :is-multi="isMulti"
                                          :is-disabled="!isearch && !iadd"
                                          :bind-key="formDataKey"
                                          @set-value="setValue">
                            </search-table>
                          </el-form-item>
                        </el-col>
                        <el-col :span="12">
                          <span class="desc-span"> {{descSet.qcbaowndp_desc}}</span>
                        </el-col>
                      </el-row>
                      <el-row :gutter="10">
                        <el-col :span="12">
                          <el-form-item label="资料录入者" prop="qcbacrtid">
                            <search-table title="资料录入者"
                                          ref="ref-qcbacrtid"
                                          :url="search.qcbacrtid.url"
                                          :table-fields="search.qcbacrtid.fields" allowCheck="1"
                                          :index="search.qcbacrtid.index"
                                          :is-multi="isMulti"
                                          :is-disabled="!isearch && !iadd"
                                          :bind-key="formDataKey"
                                          @set-value="setValue">
                            </search-table>
                          </el-form-item>
                        </el-col>
                        <el-col :span="12">
                          <span class="desc-span"> {{descSet.qcbacrtid_desc}}</span>
                        </el-col>
                      </el-row>
                      <el-row :gutter="10">
                        <el-col :span="12">
                          <el-form-item label="资料录入部门" prop="qcbacrtdp">
                            <search-table title="资料录入部门"
                                          ref="ref-qcbacrtdp"
                                          :url="search.qcbacrtdp.url"
                                          :table-fields="search.qcbacrtdp.fields" allowCheck="1"
                                          :index="search.qcbacrtdp.index"
                                          :is-multi="isMulti"
                                          :is-disabled="!isearch && !iadd"
                                          :bind-key="formDataKey"
                                          @set-value="setValue">
                            </search-table>
                          </el-form-item>
                        </el-col>
                        <el-col :span="12">
                          <span class="desc-span"> {{descSet.qcbacrtdp_desc}}</span>
                        </el-col>
                      </el-row>
                      <el-row :gutter="10">
                        <el-col :span="12">
                          <el-form-item label="资料录入日期" prop="qcbacrtdt">
                            <el-date-picker v-model="qcbacrtdtArr"
                                            v-if="isearch"
                                            format="yyyy-MM-dd HH:mm:ss"
                                            value-format="yyyy-MM-dd HH:mm:ss"
                                            type="daterange"
                                            range-separator="至"
                                            start-placeholder="开始日期"
                                            end-placeholder="结束日期"
                                            clearable
                                            :style="{width: '100%'}"
                                            :disabled="!isearch && !iadd"
                                            :picker-options="rangePickerOptions"
                                            :default-time="['00:00:00', '23:59:59']">
                            </el-date-picker>
                            <el-date-picker
                              v-model="formData.qcbacrtdt"
                              v-if="!isearch"
                              align="right"
                              type="date"
                              placeholder="选择日期"
                              format="yyyy-MM-dd HH:mm:ss"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              clearable
                              :disabled="!isearch && !iadd"
                              :picker-options="pickerOptions"
                              :style="{width:'100%'}">
                            </el-date-picker>
                          </el-form-item>
                        </el-col>
                      </el-row>
                    </div>
                  </el-card>
                </el-col>
                <el-col :span="12">
                  <el-card class="box-card" style="min-height: 380px">
                    <div slot="header" class="clearfix">
                      <span>资料归属</span>
                      <!--                      <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
                    </div>
                    <div class="text item">
                      <el-row :gutter="10">
                        <el-col :span="12">
                          <el-form-item label="最近更改者" prop="qcbamodid">
                            <search-table title="最近更改者"
                                          ref="ref-qcbamodid"
                                          :url="search.qcbamodid.url"
                                          :table-fields="search.qcbamodid.fields" allowCheck="1"
                                          :index="search.qcbamodid.index"
                                          :is-multi="isMulti"
                                          :is-disabled="!isearch && !iadd"
                                          :bind-key="formDataKey"
                                          @set-value="setValue">
                            </search-table>
                          </el-form-item>
                        </el-col>
                        <el-col :span="12">
                          <span class="desc-span"> {{descSet.qcbamodid_desc}}</span>
                        </el-col>
                      </el-row>
                      <el-row :gutter="10">
                        <el-col :span="12">
                          <el-form-item label="最近更改日期" prop="qcbamoddt">
                            <el-date-picker v-model="qcbamoddtArr"
                                            v-if="isearch"
                                            format="yyyy-MM-dd  HH:mm:ss"
                                            value-format="yyyy-MM-dd HH:mm:ss"
                                            type="daterange"
                                            range-separator="至"
                                            start-placeholder="开始日期"
                                            end-placeholder="结束日期"
                                            clearable
                                            :style="{width: '100%'}"
                                            :disabled="!isearch && !iadd"
                                            :picker-options="rangePickerOptions"
                                            :default-time="['00:00:00', '23:59:59']">
                            </el-date-picker>
                            <el-date-picker
                              v-model="formData.qcbamoddt"
                              v-if="!isearch"
                              align="right"
                              type="date"
                              placeholder="选择日期"
                              format="yyyy-MM-dd HH:mm:ss"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              clearable
                              :disabled="!isearch && !iadd"
                              :picker-options="pickerOptions"
                              :style="{width:'100%'}">
                            </el-date-picker>
                          </el-form-item>
                        </el-col>
                      </el-row>
                      <el-row :gutter="10">
                        <el-col :span="12">
                          <el-form-item label="资料审核者" prop="qcbacnfid">
                            <search-table title="资料更改者"
                                          ref="ref-qcbacnfid"
                                          :url="search.qcbacnfid.url"
                                          :table-fields="search.qcbacnfid.fields" allowCheck="1"
                                          :index="search.qcbacnfid.index"
                                          :is-multi="isMulti"
                                          :is-disabled="!isearch && !iadd"
                                          :bind-key="formDataKey"
                                          @set-value="setValue">
                            </search-table>
                          </el-form-item>
                        </el-col>
                        <el-col :span="12">
                          <span class="desc-span"> {{descSet.qcbacnfid_desc}}</span>
                        </el-col>
                      </el-row>
                      <el-row :gutter="10">
                        <el-col :span="12">
                          <el-form-item label="资料更改日期" prop="qcbacnfdt">
                            <el-date-picker v-model="qcbacnfdtArr"
                                            v-if="isearch"
                                            format="yyyy-MM-dd  HH:mm:ss"
                                            value-format="yyyy-MM-dd HH:mm:ss"
                                            type="daterange"
                                            range-separator="至"
                                            start-placeholder="开始日期"
                                            end-placeholder="结束日期"
                                            clearable
                                            :style="{width: '100%'}"
                                            :disabled="!isearch && !iadd"
                                            :picker-options="rangePickerOptions"
                                            :default-time="['00:00:00', '23:59:59']">
                            </el-date-picker>
                            <el-date-picker
                              v-model="formData.qcbacnfdt"
                              v-if="!isearch"
                              align="right"
                              type="date"
                              placeholder="选择日期"
                              format="yyyy-MM-dd"
                              value-format="yyyy-MM-dd"
                              clearable
                              :disabled="!isearch && !iadd"
                              :picker-options="pickerOptions"
                              :style="{width:'100%'}">
                            </el-date-picker>
                          </el-form-item>
                        </el-col>
                      </el-row>
                    </div>
                  </el-card>
                </el-col>
              </el-row>
            </el-tab-pane>
          </el-tabs>
        </div>
        <div class="area-3">
          <el-row :gutter="10">
            <el-col :span="16">
              <div class="tab-2-1">
                <el-tabs v-model="activeName2" type="border-card">
                  <el-tab-pane label="抽样与结果" name="tab-2-1">
                    <el-table size="mini" border v-table-fit :data="qcbdDataList" ref="list-table-qcbd" id="list-table-qcbd" height="200px"
                              @row-click="clickQcbdRow"
                              @row-dblclick="dbClickQcbdRow"
                              :row-class-name="tableRowClassNameQcbd">
                      <el-table-column property="qcbdseq" label="行序"></el-table-column>
                      <el-table-column property="qcbd001" label="检验项目"></el-table-column>
                      <el-table-column property="qcbd001_desc" label="说明"></el-table-column>
                      <el-table-column property="qcbd002" label="检验位置"></el-table-column>
                      <el-table-column property="qcbd003" label="缺点等级">
                        <template v-slot="scope">
                          <span v-if="scope.row.qcbd003 === '1'">1:Critical</span>
                          <span v-if="scope.row.qcbd003 === '2'">2:Major</span>
                          <span v-if="scope.row.qcbd003 === '3'">3:Minor</span>
                        </template>
                      </el-table-column>
                      <el-table-column property="qcbd020" label="抽样计划">
                        <template v-slot="scope">
                          <span v-if="scope.row.qcbd020 === '1'">1:GB2828</span>
                          <span v-if="scope.row.qcbd020 === '2'">2:C=0</span>
                          <span v-if="scope.row.qcbd020 === '3'">3:1916计数</span>
                          <span v-if="scope.row.qcbd020 === '4'">4:1916计量</span>
                          <span v-if="scope.row.qcbd020 === '5'">5:百分比</span>
                          <span v-if="scope.row.qcbd020 === '6'">6:自定义公式</span>
                          <span v-if="scope.row.qcbd020 === '7'">7:全检</span>
                        </template>
                      </el-table-column>
                      <el-table-column property="qcbd004" label="AQL"></el-table-column>
                      <el-table-column property="qcbd005" label="允收数"></el-table-column>
                      <el-table-column property="qcbd006" label="拒绝数"></el-table-column>
                      <el-table-column property="qcbd007" label="K法标准值"></el-table-column>
                      <el-table-column property="qcbd008" label="F法标准值"></el-table-column>
                      <el-table-column property="qcbd009" label="抽检量" width="120px">
                        <template v-slot="scope">
                          <span v-show="!scope.row.qcbd009Edit">{{scope.row.qcbd009}}</span>
                          <el-input v-show="scope.row.qcbd009Edit"
                                    v-model="scope.row.qcbd009"
                                    type="number"
                                    :id="'ref-qcbd009-' + scope.$index"
                                    @change="changeQcbdRowData(scope.row, scope.$index,'qcbd009',true)"
                                    @keyup.enter.native="changeQcbdRowData(scope.row,scope.$index, 'qcbd009',true)"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column property="qcbd010" label="缺点数" width="120px">
                        <template v-slot="scope">
                          <span v-show="!scope.row.qcbd010Edit">{{scope.row.qcbd010}}</span>
                          <el-input v-show="scope.row.qcbd010Edit"
                                    v-model="scope.row.qcbd010"
                                    type="number"
                                    :id="'ref-qcbd010-' + scope.$index"
                                    @change="changeQcbdRowData(scope.row, scope.$index,'qcbd010',true)"
                                    @keyup.enter.native="changeQcbdRowData(scope.row,scope.$index, 'qcbd010',true)"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column property="qcbd021" label="不良数" width="120px">
                        <template v-slot="scope">
                          <span v-show="!scope.row.qcbd021Edit">{{scope.row.qcbd021}}</span>
                          <el-input v-show="scope.row.qcbd021Edit"
                                    v-model="scope.row.qcbd021"
                                    type="number"
                                    :id="'ref-qcbd021-' + scope.$index"
                                    @change="changeQcbdRowData(scope.row, scope.$index,'qcbd021',true)"
                                    @keyup.enter.native="changeQcbdRowData(scope.row,scope.$index, 'qcbd021',true)"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column property="qcbd011" label="项目判定结果">
                        <template v-slot="scope">
                          <span v-if="scope.row.qcbd011 === '1'">1:1级</span>
                          <span v-if="scope.row.qcbd011 === '2'">2:2级</span>
                          <span v-if="scope.row.qcbd011 === '3'">3:3级</span>
                          <span v-if="scope.row.qcbd011 === '4'">4:3级</span>
                          <span v-if="scope.row.qcbd011 === '5'">5:5级</span>
                          <span v-if="scope.row.qcbd011 === '6'">6:6级</span>
                          <span v-if="scope.row.qcbd011 === '7'">7:7级</span>
                          <span v-if="scope.row.qcbd011 === 'R'">7:减量检验</span>
                          <span v-if="scope.row.qcbd011 === 'T'">7:加严检验</span>
                        </template>
                      </el-table-column>
                      <el-table-column property="bz" label="长备注" width="200px">
                        <template v-slot="scope">
                          <span v-show="!scope.row.bzEdit">{{scope.row.bz}}</span>
                          <el-input v-show="scope.row.bzEdit"
                                    v-model="scope.row.bz"
                                    type="text"
                                    :id="'ref-bz-' + scope.$index"
                                    @change="changeQcbdRowData(scope.row, scope.$index,'bz',true)"
                                    @keyup.enter.native="changeQcbdRowData(scope.row,scope.$index, 'bz',true)"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column
                        fixed="right"
                        label="操作"
                        v-if="iedit"
                        width="150">
                        <template v-slot="scope">
                          <!--                  <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>-->
                          <el-button type="primary" size="small" icon="el-icon-edit" circle @click.prevent="editQcbd(scope.row,scope.$index)"></el-button>
                          <el-button type="danger" size="small" icon="el-icon-delete" circle  @click.prevent="deleteQcbd(scope.$index)"></el-button>
<!--                          <el-button type="primary" size="mini" icon="el-icon-plus" circle-->
<!--                                     @click.prevent="addQcbd(scope.row,scope.$index)"-->
<!--                                     v-if="scope.$index === qcbdDataList.length-1">-->
<!--                          </el-button>-->
                        </template>
                      </el-table-column>
                    </el-table>
                  </el-tab-pane>
                  <el-tab-pane label="检验规格" name="tab-2-2">
                    <el-table size="mini" border v-table-fit :data="qcbd2DataList" ref="list-table-qcbd2" height="200px" @row-click="clickQcbd2Row" :row-class-name="tableRowClassNameQcbd2">
                      <el-table-column property="qcbdseq" label="行序"></el-table-column>
                      <el-table-column property="qcbd001" label="检验项目"></el-table-column>
                      <el-table-column property="qcbd001_desc" label="说明"></el-table-column>
                      <el-table-column property="qcbd002" label="检验位置"></el-table-column>
                      <el-table-column property="qcbd012" label="规范上限"></el-table-column>
                      <el-table-column property="qcbd013" label="检验上限"></el-table-column>
                      <el-table-column property="qcbd014" label="检验标准值"></el-table-column>
                      <el-table-column property="qcbd015" label="检验下限"></el-table-column>
                      <el-table-column property="qcbd016" label="规范下限"></el-table-column>
                      <el-table-column property="qcbd017" label="计量单位"></el-table-column>
                      <el-table-column property="qcbd018" label="检验规格说明"></el-table-column>
                      <el-table-column property="qcbd019" label="备注"></el-table-column>
<!--                      <el-table-column-->
<!--                        fixed="right"-->
<!--                        label="操作"-->
<!--                        width="150">-->
<!--                        <template v-slot="scope">-->
<!--                          &lt;!&ndash;                  <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>&ndash;&gt;-->
<!--                          <el-button type="primary" size="small" icon="el-icon-edit" circle></el-button>-->
<!--                          <el-button type="danger" size="small" icon="el-icon-delete" circle></el-button>-->
<!--                        </template>-->
<!--                      </el-table-column>-->
                    </el-table>
                  </el-tab-pane>
                </el-tabs>
              </div>
            </el-col>
            <el-col :span="8">
              <div class="tab-1-1-1">
                <el-row :gutter="10">
                  <el-tabs v-model="activeName3" type="border-card">
                    <el-tab-pane label="缺点原因" name="tab-3-1">
                      <div class="table-button" v-show="iedit">
                        <el-button type="primary" size="mini" icon="el-icon-plus" circle
                                   @click.prevent="addQcbe">
                        </el-button>
                      </div>
                      <el-table size="mini" border v-table-fit :data="qcbeDataList" ref="list-table-qcbe"
                                height="200px"
                                @row-click="clickQcbeRow"
                                @row-dblclick="dbClickQcbeRow"
                                :row-class-name="tableRowClassNameQcbe">
                        <el-table-column property="qcbe001" label="缺点原因" width="130px">
                          <template v-slot="scope">
                            <span v-show="!scope.row.qcbe001Edit">{{scope.row.qcbe001}}</span>
                            <search-table title="判定结果编号"
                                          v-show="scope.row.qcbe001Edit"
                                          :ref="'ref-qcbe001-' + scope.$index"
                                          :url="search.qcbe001.url"
                                          :table-fields="search.qcbe001.fields"
                                          :index="search.qcbe001.index"
                                          :is-multi="isMulti"
                                          :bind-key="qcbeKey"
                                          :condition="search.qcbe001.condition"
                                          :default-val="scope.row.qcbe001"
                                          :not-clearable="true"
                                          :id="'ref-qcbe001-' + scope.$index"
                                          @set-value="setValue"
                                          @get-condition="getCondition"
                            ></search-table>
                          </template>
                        </el-table-column>
                        <el-table-column property="qcbe001_desc" label="说明"></el-table-column>
                        <el-table-column property="qcbe002" label="缺点数" width="80px">
                          <template v-slot="scope">
                            <span v-show="!scope.row.qcbe002Edit">{{scope.row.qcbe002}}</span>
                            <el-input v-show="scope.row.qcbe002Edit"
                                      v-model="scope.row.qcbe002"
                                      type="number"
                                      :id="'ref-qcbe002-' + scope.$index"
                                      @change="changeQcbeRowData(scope.row, scope.$index,'qcbe002',true)"
                                      @keyup.enter.native="changeQcbeRowData(scope.row,scope.$index, 'qcbe002',true)"></el-input>
                          </template>
                        </el-table-column>
                        <el-table-column property="qcbe004" label="不良数" width="80px">
                          <template v-slot="scope">
                            <span v-show="!scope.row.qcbe004Edit">{{scope.row.qcbe004}}</span>
                            <el-input v-show="scope.row.qcbe004Edit"
                                      v-model="scope.row.qcbe004"
                                      type="number"
                                      :id="'ref-qcbe004-' + scope.$index"
                                      @change="changeQcbeRowData(scope.row, scope.$index,'qcbe004',true)"
                                      @keyup.enter.native="changeQcbeRowData(scope.row,scope.$index, 'qcbe004',true)"></el-input>
                          </template>
                        </el-table-column>
                        <el-table-column property="qcbe003" label="备注" width="120px">
                          <template v-slot="scope">
                            <span v-show="!scope.row.qcbe003Edit">{{scope.row.qcbe003}}</span>
                            <el-input v-show="scope.row.qcbe003Edit"
                                      v-model="scope.row.qcbe003"
                                      type="text"
                                      :id="'ref-qcbe003-' + scope.$index"
                                      @change="changeQcbeRowData(scope.row, scope.$index,'qcbe003',true)"
                                      @keyup.enter.native="changeQcbeRowData(scope.row,scope.$index, 'qcbe003',true)"></el-input>
                          </template>
                        </el-table-column>
                        <el-table-column
                          fixed="right"
                          label="操作"
                          v-if="iedit"
                          width="110">
                          <template v-slot="scope">
                            <!--                  <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>-->
                            <el-button type="primary" size="small" icon="el-icon-edit" circle @click.prevent="editQcbe(scope.row,scope.$index)"></el-button>
                            <el-button type="danger" size="small" icon="el-icon-delete" circle @click.prevent="deleteQcbe(scope.$index)"></el-button>
                          </template>
                        </el-table-column>
                      </el-table>
                    </el-tab-pane>
                  </el-tabs>
                </el-row>
              </div>
            </el-col>
          </el-row>
        </div>
      </el-form>
    </div>
    <div class="list-area">
      <el-drawer
        ref="draw"
        title="结果列表"
        :visible.sync="listVisible"
        direction="rtl"
        :destroy-on-close="true"
        size="80%">
        <el-table size="mini" border v-table-fit :data="dataList" ref="list-table"
                  @row-click="rowClick" :row-class-name="tableRowClassName">
          <el-table-column property="qcbadocno" label="检验单号" width="150px"></el-table-column>
          <el-table-column property="qcbadocno_desc" label="说明"></el-table-column>
          <el-table-column property="qcbadocdt" label="单据日期"></el-table-column>
          <el-table-column property="qcba000" label="检验类型">
            <template v-slot="scope">
              <span v-if="scope.row.qcba000 === '1'">1:IQC</span>
              <span v-if="scope.row.qcba000 === '2'">2:FQC</span>
              <span v-if="scope.row.qcba000 === '3'">3:PQC</span>
              <span v-if="scope.row.qcba000 === '4'">4:OQC</span>
              <span v-if="scope.row.qcba000 === '5'">5:Inventory QC</span>
              <span v-if="scope.row.qcba000 === '6'">6:RQC</span>
            </template>
          </el-table-column>
          <el-table-column property="qcba900" label="开单人员"></el-table-column>
          <el-table-column property="qcba900_desc" label="全名"></el-table-column>
          <el-table-column property="qcba901" label="开单部门"></el-table-column>
          <el-table-column property="qcba901_desc" label="开单部门"></el-table-column>
        </el-table>
        <pagination
          :v_show="dataTotal >0"
          :total="dataTotal"
          :page.sync="pageNum"
          :limit.sync="pageSize"
          @pagination="searchList(true)"
        />
      </el-drawer>
    </div>
    <div class="page-bottom">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        layout="total,sizes, prev, pager, next, jumper"
        :current-page="currentIndex"
        :page-sizes="[1]"
        :page-size="1"
        :total="dataTotal">
      </el-pagination>
    </div>
  </div>
</template>
<script>
import aqct300 from "@/api/T100/aqct300";

export default {
  props: [],
  data() {
    return {
      formData: {
        qcbadocno: undefined,
        qcbadocdt: undefined,
        qcba900: undefined,
        qcba000: undefined,
        qcba001: undefined,
        qcba002: undefined,
        qcba031: undefined,
        qcba901: undefined,
        qcba032: undefined,
        qcba029: undefined,
        qcba003: undefined,
        qcba004: undefined,
        qcba005: undefined,
        qcbaud001: undefined,
        qcbaud002: undefined,
        qcba006: undefined,
        qcba007: undefined,
        qcba008: undefined,
        qcba009: undefined,
        qcba017: undefined,
        qcba010: undefined,
        qcba010_desc1: undefined,
        imaa041: undefined,
        qcba010_desc2: undefined,
        qcba034: undefined,
        qcba013: undefined,
        qcba035: undefined,
        qcba020: undefined,
        qcba021: undefined,
        qcba024: undefined,
        qcba016: undefined,
        qcba022: undefined,
        qcbaud011: undefined,
        qcbaud003: undefined,
        qcba023: undefined,
        qcba027: undefined,
        khdgdh: undefined,
        qcbaownid:undefined,
        qcbaowndp:undefined,
        qcbacrtid:undefined,
        qcbacrtdp:undefined,
        qcbacrtdt:undefined,
        qcbamodid:undefined,
        qcbamoddt:undefined,
        qcbacnfid:undefined,
        qcbacnfdt:undefined,
      },
      emptyFormData: undefined,
      currentFormData: undefined,
      searchFormData: undefined,
      formDataKey:'formData',
      qcbcKey:'qcbc',
      qcbdKey:'qcbd',
      qcbeKey:'qcbe',
      qcbadocdtArr: undefined,
      qcba035Arr: undefined,
      qcbacrtdtArr:undefined,
      qcbamoddtArr:undefined,
      qcbacnfdtArr:undefined,
      stusTxt:'',

      search: {
        qcbadocno: {
          url: this.$uri.aqct300.qcbadocno,
          fields: [
            {label: '单号', prop: 'qcbadocno', queryProp:'qcbadocno', type: 'text'},
            {label: '单据日期', prop: 'qcbadocdt', queryProp:'qcbadocdt', type: 'date'},
            {label: '来源单号', prop: 'qcba001', queryProp:'qcba001', type: 'text'},
            {label: '来源单项次', prop: 'qcba002', queryProp:'qcba002', type: 'number'}],
          index: 'qcbadocno'
        },
        qcba900: {
          url: this.$uri.aqct300.qcba900,
          fields: [
            {label: '员工编号', prop: 'qcba900', queryProp:'ooag001', type: 'number'},
            {label: '员工姓名', prop: 'ooag011', queryProp:'ooag011', type: 'text'}],
          index: 'qcba900'
        },
        qcba901: {
          url: this.$uri.aqct300.qcba901,
          fields: [
            {label: '部门编号', prop: 'qcba901', queryProp: 'ooeg001', type: 'number'},
            {label: '说明', prop: 'ooefl003', queryProp: 'ooefl003', type: 'text'}],
          index: 'qcba901'
        },
        qcba001: {
          url: this.$uri.aqct300.qcba001,
          fields: [
            {label: '来源单号', prop: 'qcba001', queryProp: 'qcba001', type: 'text'}],
          index: 'qcba001'
        },
        qcba002: {
          url: this.$uri.aqct300.qcba002,
          fields: [
            {label: '来源单号', prop: 'qcba001', queryProp: 'qcba001', type: 'text'},
            {label: '来源单项次', prop: 'qcba002', queryProp: 'qcba002', type: 'number'}],
          index: 'qcba002',
          condition: [{prop:'qcba001',queryProp:'qcba001'}]
        },
        qcba005: {
          url: this.$uri.aqct300.qcba005,
          fields: [
            {label: '交易对象编号', prop: 'qcba005', queryProp: 'pmaal001', type: 'text'},
            {label: '交易对象全名', prop: 'pmaal003', queryProp: 'pmaal003', type: 'text'},
            {label: '交易对象简称', prop: 'pmaal004', queryProp: 'pmaal004', type: 'text'},
            {label: '税号', prop: 'pmaa003', queryProp: 'pmaa003', type: 'text'},
            {label: '所属法人', prop: 'pmaa005', queryProp: 'pmaa005', type: 'text'},
            {label: '供应商分类', prop: 'pmaa080', queryProp: 'pmaa080', type: 'text'}],
          index: 'qcba005'
        },
        qcba006: {
          url: this.$uri.aqct300.qcba006,
          fields: [
            {label: '本站作业', prop: 'qcba006', queryProp: 'ecbb004', type: 'text'},
            {label: '说明', prop: 'oocql004', queryProp: 'oocql004', type: 'text'},
            {label: '作业序', prop: 'ecbb005', queryProp: 'ecbb005', type: 'text'}],
          index: 'qcba006'
        },
        qcba009: {
          url: this.$uri.aqct300.qcba009,
          fields: [
            {label: '单位', prop: 'qcba009', queryProp: 'ooca001', type: 'text'},
            {label: '说明', prop: 'oocal003', queryProp: 'oocal003', type: 'text'}],
          index: 'qcba009'
        },
        qcba010: {
          url: this.$uri.aqct300.qcba010,
          fields: [
            {label: '料号', prop: 'qcba010', queryProp: 'imaal001', type: 'text'},
            {label: '品名', prop: 'imaal003', queryProp: 'imaal003', type: 'text'},
            {label: '规格', prop: 'imaal004', queryProp: 'imaal004', type: 'text'}],
          index: 'qcba010'
        },
        qcba013: {
          url: this.$uri.aqct300.qcba013,
          fields: [
            {label: '应用分类码', prop: 'qcba013', queryProp: 'oocq002', type: 'text'},
            {label: '说明', prop: 'oocql004', queryProp: 'oocql004', type: 'text'}],
          index: 'qcba013'
        },
        qcba024: {
          url: this.$uri.aqct300.qcba024,
          fields: [
            {label: '员工编号', prop: 'qcba024', queryProp: 'ooag001', type: 'number'},
            {label: '员工姓名', prop: 'ooag011', queryProp: 'ooag011', type: 'text'}],
          index: 'qcba024'
        },
        qcba016: {
          url: this.$uri.aqct300.qcba016,
          fields: [
            {label: '单位', prop: 'qcba016', queryProp:'ooca001',type: 'text'},
            {label: '说明', prop: 'oocal003', queryProp:'oocal003', type: 'text'}],
          index: 'qcba016'
        },

        qcbc002: {
          url: this.$uri.aqct300.qcbc002,
          fields: [
            {label: '判定结果编号', prop: 'qcbc002', queryProp:'qcao002', type: 'text'},
            {label: '说明', prop: 'qcaol004', queryProp:'qcaol004', type: 'text'},
            {label: '判定区分', prop: 'qcao003', queryProp:'qcao003', type: 'select'},
            {label: 'IQC处理方式', prop: 'qcao004', queryProp:'qcao004', type: 'select'}],
          index: 'qcbc002'
        },
        qcbc005: {
          url: this.$uri.aqct300.qcbc005,
          fields: [
            {label: '库位编号', prop: 'qcbc005', queryProp:'inaa001', type: 'text'},
            {label: '说明', prop: 'inayl003', queryProp:'inayl003', type: 'text'}],
          index: 'qcbc005'
        },
        qcbc006: {
          url: this.$uri.aqct300.qcbc006,
          fields: [
            {label: '储位编号', prop: 'qcbc006', queryProp:'inab002', type: 'text'},
            {label: '储位名称', prop: 'inab003', queryProp:'inab003', type: 'text'}],
          index: 'qcbc006',
          condition: [{prop: 'qcbc005',queryProp:'inab001'}]
        },
        qcbe001: {
          url: this.$uri.aqct300.qcbe001,
          fields: [
            {label: '应用分类码', prop: 'qcbe001', queryProp:'oocq002', type: 'text'},
            {label: '说明', prop: 'oocql004', queryProp:'inab003', type: 'text'}],
          index: 'qcbe001',
          condition: [{prop: 'qcbd001',queryProp:'oocq004',conditionKey:'qcbd'}]
        },
        qcbaownid: {
          url: this.$uri.aqct300.qcbaownid,
          fields: [
            {label: '员工编号', prop: 'qcbaownid', queryProp:'ooag001', type: 'number'},
            {label: '员工姓名', prop: 'ooag011', queryProp:'ooag011', type: 'text'}],
          index: 'qcbaownid'
        },
        qcbaowndp: {
          url: this.$uri.aqct300.qcbaowndp,
          fields: [
            {label: '部门编号', prop: 'qcbaowndp', queryProp: 'ooeg001', type: 'number'},
            {label: '说明', prop: 'ooefl003', queryProp: 'ooefl003', type: 'text'}],
          index: 'qcbaowndp'
        },
        qcbacrtid: {
          url: this.$uri.aqct300.qcbacrtid,
          fields: [
            {label: '员工编号', prop: 'qcbacrtid', queryProp:'ooag001', type: 'number'},
            {label: '员工姓名', prop: 'ooag011', queryProp:'ooag011', type: 'text'}],
          index: 'qcbacrtid'
        },
        qcbacrtdp: {
          url: this.$uri.aqct300.qcbacrtdp,
          fields: [
            {label: '部门编号', prop: 'qcbacrtdp', queryProp: 'ooeg001', type: 'number'},
            {label: '说明', prop: 'ooefl003', queryProp: 'ooefl003', type: 'text'}],
          index: 'qcbacrtdp'
        },
        qcbamodid: {
          url: this.$uri.aqct300.qcbamodid,
          fields: [
            {label: '员工编号', prop: 'qcbamodid', queryProp:'ooag001', type: 'number'},
            {label: '员工姓名', prop: 'ooag011', queryProp:'ooag011', type: 'text'}],
          index: 'qcbamodid'
        },
        qcbacnfid: {
          url: this.$uri.aqct300.qcbacnfid,
          fields: [
            {label: '员工编号', prop: 'qcbacnfid', queryProp:'ooag001', type: 'number'},
            {label: '员工姓名', prop: 'ooag011', queryProp:'ooag011', type: 'text'}],
          index: 'qcbacnfid'
        },
      },
      rules: {
        // qcbadocno: [{
        //   required: true,
        //   message: '请输入检验单号',
        //   trigger: 'blur'
        // }],
        // qcbadocdt: [{
        //   required: true,
        //   message: '请选择单据日期',
        //   trigger: 'change'
        // }],
        // qcba900: [{
        //   required: true,
        //   message: '请输入开单人员',
        //   trigger: 'blur'
        // }],
        // qcba000031: [{
        //   required: true,
        //   type: 'array',
        //   message: '请至少选择一个qcba000031',
        //   trigger: 'change'
        // }],
        // qcba901: [{
        //   required: true,
        //   message: '请输入开单部门',
        //   trigger: 'blur'
        // }],
        // qcba032: [{
        //   required: true,
        //   message: '请输入质量异常申请单号',
        //   trigger: 'blur'
        // }],
      },
      activeName: "tab-1-1",
      activeName2: "tab-2-1",
      activeName3: "tab-3-1",
      qcba000031Options: [],
      qcba000031Props: {
        "multiple": false
      },
      isMulti: true,  //修改为false,其他情况为true
      isearch: false,
      iadd: false,
      iedit: false,
      listVisible: false,

      dataList: [],
      qcbcDataList: [],
      qcbdDataList: [],
      qcbd2DataList: [],
      qcbeDataList: [],

      // bakDataList:[],
      // bakQcbcDataList: [],
      // bakQcbdDataList: [],
      // bakQcbd2DataList: [],
      // bakQcbeDataList: [],

      currentIndex: 1,
      currentQcbcIndex: undefined,
      currentQcbdIndex: undefined,
      currentQcbd2Index: undefined,
      currentQcbeIndex: undefined,

      dataTotal: 0,
      pageNum: 1,
      pageSize: 10,
      rangePickerOptions: {
        disabledDate(time) {
          // return time.getTime() > Date.now();
          const endOfToday = new Date();
          endOfToday.setHours(23);
          endOfToday.setMinutes(59);
          endOfToday.setSeconds(59);
          return time.getTime() > endOfToday
        },
        shortcuts: [{
          text: '今天',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setHours(0);
            start.setMinutes(0);
            start.setSeconds(0);
            end.setHours(23);
            end.setMinutes(59);
            end.setSeconds(59);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近一周',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setHours(0);
            start.setMinutes(0);
            start.setSeconds(0);
            end.setHours(23);
            end.setMinutes(59);
            end.setSeconds(59);
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近一个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setHours(0);
            start.setMinutes(0);
            start.setSeconds(0);
            end.setHours(23);
            end.setMinutes(59);
            end.setSeconds(59);
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近三个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setHours(0);
            start.setMinutes(0);
            start.setSeconds(0);
            end.setHours(23);
            end.setMinutes(59);
            end.setSeconds(59);
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近六个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setHours(0);
            start.setMinutes(0);
            start.setSeconds(0);
            end.setHours(23);
            end.setMinutes(59);
            end.setSeconds(59);
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 180);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近一年',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setHours(0);
            start.setMinutes(0);
            start.setSeconds(0);
            end.setHours(23);
            end.setMinutes(59);
            end.setSeconds(59);
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 365);
            picker.$emit('pick', [start, end]);
          }
        }]
      },
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now();
        },
        shortcuts: [{
          text: '今天',
          onClick(picker) {
            picker.$emit('pick', new Date());
          }
        }, {
          text: '昨天',
          onClick(picker) {
            const date = new Date();
            date.setTime(date.getTime() - 3600 * 1000 * 24);
            picker.$emit('pick', date);
          }
        }, {
          text: '一周前',
          onClick(picker) {
            const date = new Date();
            date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
            picker.$emit('pick', date);
          }
        }]
      },
      qcba000Options: [
        {
          value: '1',
          label: '1:IQC'
        },
        {
          value: '2',
          label: '2:FQC'
        },
        {
          value: '3',
          label: '3:PQC'
        },
        {
          value: '4',
          label: '4:OQC'
        },
        {
          value: '5',
          label: '5:Inventory QC'
        },
        {
          value: '6',
          label: '6:RQC'
        }
      ],
      qcba000Loading: false,
      qcba031Options: [],
      defaultQcba031Options: [
        {
          value: '1',
          label: '1:杂项发料单'
        },
        {
          value: '2',
          label: '2:杂项收料单'
        },
        {
          value: '3',
          label: '3:一阶段调拨'
        },
        {
          value: '4',
          label: '4:俩阶段调拨'
        },
        {
          value: '5',
          label: '5:报废申请'
        },
        {
          value: '6',
          label: '6:仓库检验申请单'
        },
        {
          value: '7',
          label: '7:销售退货单'
        }
      ],
      qcba031Loading: false,
      qcba031Disabled: false,
      qcbaud001Options: [
        {
          value: '0',
          label: '0:无'
        },
        {
          value: '1',
          label: '1:有'
        }
      ],
      qcbaud002Options: [
        {
          value: '0',
          label: '0:无'
        },
        {
          value: '1',
          label: '1:有'
        }
      ],
      qcba021Options: [
        {
          value: 'A',
          label: 'A:紧急'
        },
        {
          value: 'B',
          label: 'B:重要'
        },
        {
          value: 'C',
          label: 'C:一般'
        }
      ],
      qcba022Options: [
        {
          value: '0',
          label: '0:检验中'
        },
        {
          value: '1',
          label: '1:合格'
        },
        {
          value: '2',
          label: '2:验退'
        },
        {
          value: '3',
          label: '3:返工'
        },
        {
          value: '4',
          label: '4:特采'
        },
        {
          value: '5',
          label: '5:报废'
        }
      ],
      qcbaud003Options: [
        {
          value: '1',
          label: '1:千克'
        },
        {
          value: '1000',
          label: '1000:克'
        }
      ],
      loading: false,
      editStus:{
        qcbc: false
      },
      qcbc001Options:[
        {
          value:'0',
          label:'0:一般产品'
        }
      ],
      checkSuccess:false,
      translateLatest:{},
      descSet:{
        qcba900_desc:'',
      }
    }
  },
  computed: {},
  watch: {
    'qcbadocdtArr': {
      deep: true,
      handler(newV, oldV) {
        if (!this.isearch) return;
        this.formData.qcbadocdt = 'daterange:' + newV.join(',');
      }
    },
    'qcba035Arr': {
      deep: true,
      handler(newV, oldV) {
        if (!this.isearch) return;
        this.formData.qcba035 = 'daterange:' + newV.join(',');
      }
    },
    'qcbacrtdtArr': {
      deep: true,
      handler(newV, oldV) {
        if (!this.isearch) return;
        this.formData.qcbacrtdt = 'daterange:' + newV.join(',');
      }
    },
    'qcbamoddtArr': {
      deep: true,
      handler(newV, oldV) {
        if (!this.isearch) return;
        this.formData.qcbamoddt = 'daterange:' + newV.join(',');
      }
    },
    'qcbacnfdtArr': {
      deep: true,
      handler(newV, oldV) {
        if (!this.isearch) return;
        this.formData.qcbacnfdt = 'daterange:' + newV.join(',');
      }
    },
    'formData': {
      deep: true,
      handler(newV, oldV) {
        for (let key in newV) {
          let $ref = this.$refs['ref-' + key];
          if($ref) {
            let keyWord = $ref.getKeyWord()
            if (newV[key] !== keyWord) {
              this.translateVal2('formData',key,keyWord,true)
              // console.log('updata child ref[ref-' + $ref.index + ']','value:' + keyWord+ "->" +newV[key])
              this.$refs['ref-' + key].updateValue(newV[key])
            }


          }
        }
        this.qcba031Focus();

      }
    },
    'currentQcbdIndex':{
      handler(newV, oldV){
        if(oldV !== newV) {
          // this.handleClickTab2(({name:'tab-2-1'}))
        }
      }
    },
    'currentQcbd2Index':{
      handler(newV, oldV){
        if(oldV !== newV) {
          // this.handleClickTab2(({name:'tab-2-2'}))
        }
      }
    },

    'qcbcDataList': {
      deep: true,
      handler(newV, oldV) {
        // console.log(newV)
      }
    },
  },
  async created() {
    this.emptyFormData = Object.assign({}, this.formData)
    if(this.$route.params.qcbadocno && !this.formData.qcbadocno) {
      if (!this.loading) this.loading = true;
      this.formData.qcbadocno = this.$route.params.qcbadocno;
      this.searchFormData = this.formData;
      await this.searchList();
      if (this.loading) this.loading = false;
    }
  },
  mounted() {
  },
  methods: {
    // submitForm() {
    //   this.$refs['elForm1'].validate(valid => {
    //     if (!valid) return
    //     // TODO 提交表单
    //   })
    // },
    // resetForm() {
    // this.$refs['elForm1'].resetFields()
    // },
    openSearch() {
      this.isearch = true
      this.isMulti = true
      this.iadd = false
      this.iedit = false
      this.qcba031Disabled = false;
      this.pageNum = 1;
      this.currentIndex = 1;
      this.clearForm();
      // var datas = @dict.getType('sys_common_status')
      // console.log(datas)
    },
    openAdd() {
      this.isearch = false
      this.isMulti = false
      this.iadd = true
      this.iedit = false
      this.qcba031Disabled = false;
      this.clearForm();
    },
    openUpdate() {
      this.isearch = false
      this.isMulti = false
      this.iadd = false
      this.iedit = true
      this.qcba031Disabled = false;
    },
    clearForm() {
      this.formData = Object.assign({}, this.emptyFormData);
      this.dataList = []
      this.qcbcDataList = []
      this.qcbdDataList = []
      this.qcbd2DataList = []
      this.qcbeDataList = []
      this.stusTxt = '';
      this.translateLatest={};
      this.descSet={};
      this.qcbadocdtArr = undefined;
      this.qcba035Arr = undefined;
      this.qcbacrtdtArr = undefined;
      this.qcbamoddtArr = undefined;
      this.qcbacnfdtArr = undefined;
    },
    searchData() {
      setTimeout(() => {
        this.searchList();
      }, 0)

    },
    async searchList(fromPage) {
      if (!this.loading) this.loading = true;
      this.isMulti = false;
      this.qcba031Disabled = true;
      let resp = await aqct300.qcbaList(Object.assign({}, this.searchFormData, {pageSize: this.pageSize}, {pageNum: this.pageNum}));
      if (resp.code == '200') {
        this.dataList = resp.rows;
        this.dataTotal = resp.total;
        if(this.dataList.length > 0 ) {
          let index = 0;
          if (!fromPage) {
            index = this.getCurrentRowIndex();
            this.currentIndex = (this.pageNum - 1) * this.pageSize + index + 1
          } else {
            this.currentIndex = (this.pageNum - 1) * this.pageSize + 1
          }
          await this.searchByDocno(this.dataList[index].qcbadocno);
        } else {
          this.clearForm();
        }
      } else {
        this.$message.warning('查询信息异常')
      }
      if (this.loading) this.loading = false;
    },
    async searchByDocno(docno) {
      let resp = await aqct300.searchByDocno(docno);
      if (resp.code == '200') {
        this.currentFormData = resp.data
        this.formData = Object.assign({}, this.formData, this.currentFormData)
        await this.searchQcbcByDocno(docno);
        await this.searchQcbdByDocno(docno);
        let qcbdseq = await this.searchQcbd2ByDocno(docno);
        let params = {
          qcbedocno : docno,
          qcbeseq : qcbdseq
        }
        await this.searchQcbe(params);
      } else {
        this.$message.warning('查询信息异常')
      }
    },
    async searchQcbcByDocno(docno) {
      let resp = await aqct300.searchQcbcByDocno(docno);
      if (resp.code == '200') {
        this.qcbcDataList = [];
        this.qcbcDataList = resp.data;
        this.qcbcDataList.forEach(item => {
          item.qcbc001Edit = false;
          item.qcbc002Edit = false;
          item.qcbc005Edit = false;
          item.qcbc006Edit = false;
          item.qcbc007Edit = false;
          item.qcbc009Edit = false;
          item.qcbc011Edit = false;
        })
      } else {
        this.$message.warning('查询信息异常')
      }
      if(this.qcbcDataList.length > 0) {
        this.currentQcbcIndex = 0;
        // this.$refs['list-table-qcbc'].setCurrentRow(this.qcbcDataList[0]);
      }
      this.qcbcDataList = JSON.parse(JSON.stringify(this.qcbcDataList));
    },
    async searchQcbdByDocno(docno) {
      let resp = await aqct300.searchQcbdByDocno(docno);
      if (resp.code == '200') {
        this.qcbdDataList = resp.data;
      } else {
        this.$message.warning('查询信息异常')
      }
      if(this.qcbdDataList.length > 0) {
        this.currentQcbdIndex = 0;
      }
    },
    async searchQcbd2ByDocno(docno) {
      let resp = await aqct300.searchQcbd2ByDocno(docno);
      if (resp.code == '200') {
        this.qcbd2DataList = resp.data;
      } else {
        this.$message.warning('查询信息异常')
      }
      if(this.qcbd2DataList.length > 0 ) {
        this.currentQcbd2Index = 0;
        return this.qcbd2DataList[0].qcbdseq;
      } else {
        return null;
      }
    },
    async searchQcbe(params) {
      let resp = await aqct300.searchQcbe(params);
      if (resp.code == '200') {
        this.qcbeDataList = resp.data;
      } else {
        this.$message.warning('查询信息异常')
      }
      if(this.qcbeDataList.length > 0) {
        this.currentQcbeIndex = 0;
      }
    },
    // async searchByRownum(rownum){
    //   if(!this.loading) this.loading = true;
    //   let resp = await aqct300.searchByRownum(Object.assign({},this.searchFormData,{rownum:rownum}));
    //   if (resp.code == '200') {
    //     this.currentFormData = resp.data
    //     this.formData = Object.assign({},this.formData,this.currentFormData)
    //   } else {
    //     this.$message.warning('查询信息异常')
    //   }
    //   if(this.loading) this.loading = false;
    // },
    setValue(dataKey,key, newValue,close) {
      this.translateVal2(dataKey,key,newValue,false);
      if(dataKey === 'formData') {
        this[dataKey][key] = newValue;
      } else if (dataKey === 'qcbc') {
        this.qcbcDataList[this.currentQcbcIndex][key] = newValue;
        this.qcbcDataList[this.currentQcbcIndex][key+"Edit"] = false;
        this.qcbcDataList = JSON.parse(JSON.stringify(this.qcbcDataList));
        this.changeQcbcRowData(this.qcbcDataList[this.currentQcbcIndex],this.currentQcbcIndex,key,close);
        if(key === 'qcbc002'){
          if(newValue === 'A001') {
            this.qcbcDataList[this.currentQcbcIndex].qcbc012 = '6';
            this.qcbcDataList[this.currentQcbcIndex].qcbc013 = '1';
          } else if (newValue === 'A002') {
            this.qcbcDataList[this.currentQcbcIndex].qcbc012 = '1';
            this.qcbcDataList[this.currentQcbcIndex].qcbc013 = '1';
          } else if (newValue === 'A003') {
            this.qcbcDataList[this.currentQcbcIndex].qcbc012 = '4';
            this.qcbcDataList[this.currentQcbcIndex].qcbc013 = '1';
          } else if (newValue === 'A004') {
            this.qcbcDataList[this.currentQcbcIndex].qcbc012 = '1';
            this.qcbcDataList[this.currentQcbcIndex].qcbc013 = '1';
          }
        }
      } else if (dataKey === 'qcbe') {
        this.qcbeDataList[this.currentQcbeIndex][key] = newValue;
        this.qcbeDataList[this.currentQcbeIndex][key+"Edit"] = false;
        this.qcbeDataList = JSON.parse(JSON.stringify(this.qcbeDataList));
        this.changeQcbeRowData(this.qcbeDataList[this.currentQcbeIndex],this.currentQcbeIndex,key,close)
      }
    },
    getCondition(dataKey, conditions, callback)  {
      let result = {}
      conditions.forEach(c => {
        let prop = c.prop;
        let queryProp = c.queryProp;
        let conditionKey = c.conditionKey;
        if(!conditionKey) {
          conditionKey = dataKey;
        }
        if(conditionKey === 'formData') {
          result[queryProp] = this.formData[prop]
        } else if (conditionKey === 'qcbc') {
          result[queryProp] = this.qcbcDataList[this.currentQcbcIndex][prop]
        } else if (conditionKey === 'qcbd') {
          result[queryProp] = this.qcbdDataList[this.currentQcbdIndex][prop]
        } else if (conditionKey === 'qcbe') {
          result[queryProp] = this.qcbeDataList[this.currentQcbeIndex][prop]
        }
      });
      // console.log('searcgInput取得父参数',result)
      callback(result)
      return result
    },
    showList() {
      this.listVisible = true;
    },
    getQcba000SelectList(query) {
      this.qcba000Loading = true;

    },
    getQcba031SelectList(query) {

    },
    qcba000Chage(curVal) {
      if (this.isearch || curVal === '4' || curVal === '5') {
        this.qcba031Disabled = false;
      } else {
        this.qcba031Disabled = true;
      }
    },
    qcba031Focus() {
      if (this.isearch) { //都可以选
        this.qcba031Options = undefined
        this.qcba031Options = []
        this.qcba031Options = Object.assign({}, this.defaultQcba031Options);
      } else if (this.iadd || this.iedit) {
        if (this.formData.qcba000 === '4') {
          this.qcba031Options = []
          this.qcba031Options = undefined
          this.qcba031Options = [
            {
              value: '1',
              label: '1:出货通知单'
            },
            {
              value: '2',
              label: '2:出货单'
            }
          ]
        } else if (this.formData.qcba000 === '5') {
          this.qcba031Disabled = false
          this.qcba031Options = undefined
          this.qcba031Options = []
          Object.assign(this.qcba031Options, this.defaultQcba031Options);
        } else { //disable掉
          this.qcba031Disabled = true
          this.qcba031Options = undefined
          this.qcba031Options = []
        }
      }
    },
    handleClickTab1() {},
    // async handleClickTab2(tab, event) {
    //   let params = {};
    //
    //   if(this.currentFormData && this.currentFormData.qcbadocno) {
    //     params.qcbedocno = this.currentFormData.qcbadocno;
    //     if(tab.name === 'tab-2-1' ) {
    //       if(this.qcbdDataList.length > 0) {
    //         params.qcbeseq = this.qcbdDataList[this.currentQcbdIndex || 0].qcbdseq;
    //       }
    //       await this.searchQcbe(params)
    //     } else if(tab.name === 'tab-2-2') {
    //       if(this.qcbd2DataList.length > 0) {
    //         params.qcbeseq = this.qcbd2DataList[this.currentQcbd2Index || 0].qcbdseq;
    //       }
    //       await this.searchQcbe(params)
    //     }
    //   }
    // },
    async check() {
      this.checkSuccess = false;
      if (this.isearch) {
        for(let key in this.formData) {
          if(this.$refs['ref-' + key]){
            this.formData[key] = this.$refs['ref-' + key].getKeyWord();
          }
        }
        this.searchFormData = this.formData;
        this.searchData();
        this.isearch = false;
        this.iadd = false;
        this.iedit = false;
      } else if(this.iedit){
        setTimeout(async () => {
          await this.saveData();
          if(this.checkSuccess){
            this.isearch = false;
            this.iadd = false;
            this.iedit = false;
          }
        },100)
      }
    },
    cancel() {
      if(this.isearch) {
        this.clearForm();
      } else if (this.iedit) {
        if(this.formData.qcbadocno){
          this.searchByDocno(this.formData.qcbadocno)
        } else {
          this.clearForm();
        }
      }
      this.isearch = false;
      this.iadd = false;
      this.iedit = false;
    },
    deleteData() {

    },
    async confirmed() {
      if (!this.loading) this.loading = true;
      aqct300.confirmedByDocno(this.formData.qcbadocno).then(async r=>{
        this.$modal.msgSuccess("审核成功");
        await this.searchByDocno(this.formData.qcbadocno);
      }).catch(e1 =>{

      }).finally(()=>{
        if (this.loading) this.loading = false;
      })
      // let resp = await aqct300.confirmByDocno(this.formData.qcbadocno);
      // if (this.loading) this.loading = false;
      // if (resp && resp.code == '200') {
      //   this.$modal.msgSuccess("审核成功");
      //   await this.searchByDocno(this.formData.qcbadocno);
      // } else {
      //   this.$modal.msgError(resp.msg)
      //   if (this.loading) this.loading = false;
      // }
    },
    async unConfirmed() {
      if (!this.loading) this.loading = true;
      aqct300.unConfirmedByDocno(this.formData.qcbadocno).then(async r=>{
        this.$modal.msgSuccess("取消审核成功");
        await this.searchByDocno(this.formData.qcbadocno);
      }).catch(e1 =>{

      }).finally(()=>{
        if (this.loading) this.loading = false;
      })
    },
    async saveData(){
      let param = {
        qcba:JSON.stringify(this.formData),
        qcbc:JSON.stringify(this.qcbcDataList),
        qcbd:JSON.stringify(this.qcbdDataList),
        qcbe:JSON.stringify(this.qcbeDataList)
      }
      if (!this.loading) this.loading = true;
      let resp = await aqct300.saveData(param).then(async r=>{
        this.checkSuccess = true;
        this.$modal.msgSuccess("保存成功");
        await this.searchByDocno(this.formData.qcbadocno);
      }).catch(e1 =>{

      }).finally(()=>{
        if (this.loading) this.loading = false;
      });
    },
    async handleCurrentChange(val) {
      this.currentIndex = val;
      let index = this.getCurrentRowIndex();
      if (val >= this.pageSize * (this.pageNum - 1) + 1 && val < this.pageSize * this.pageNum + 1) {
        if (!this.loading) this.loading = true;
        await this.searchByDocno(this.dataList[index].qcbadocno);
        if (this.loading) this.loading = false;
      } else {
        this.pageNum = parseInt((val - 1) / this.pageSize) + 1;
        this.searchList();
        // this.searchByRownum(val);
      }
    },
    handleSizeChange(val) {
      // console.log(`每页 ${val} 条`);
    },
    rowClick(row, column, e) {
      this.listVisible = false
      this.currentIndex = this.pageSize * (this.pageNum - 1) + e.currentTarget.rowIndex + 1;

      if (!this.loading) this.loading = true;
      this.searchByDocno(row.qcbadocno)
      if (this.loading) this.loading = false;
    },

    clickQcbcRow(row, column, e) {
      // let oldIndex = Object.assign({},this.currentQcbcIndex);
      if(!column) return;
      this.currentQcbcIndex = e.currentTarget.rowIndex;
      if(!this.iedit) return;
      // ['qcbc001','qcbc002','qcbc005','qcbc006','qcbc007','qcbc009','qcbc011'].forEach(pr => {
      //   for (let i = 0; i < this.qcbcDataList.length; i++) {
      //     if(!column.property && i === this.currentQcbcIndex) {
      //       this.qcbcDataList['qcbc001Edit'] = false;
      //     } else {
      //       if(pr !== column.property || i !== this.currentQcbcIndex) {
      //         this.qcbcDataList[i][pr+'Edit'] = false;
      //       }
      //     }
      //   }
      // })
    },
    dbClickQcbcRow(row, column, e) {
      if(!column) return;
      this.currentQcbcIndex = e.currentTarget.rowIndex;
      if(!this.iedit) return;

      // if(editArr.findIndex(i => i === column.property) > -1) {
      //   this.qcbcDataList[this.currentQcbcIndex][column.property+'Edit'] = true;
      // } else {
      //   this.qcbcDataList[this.currentQcbcIndex]['qcbc001Edit'] = true;
      // }
      let editArr = ['qcbc001','qcbc002','qcbc005','qcbc006','qcbc007','qcbc009','qcbc011'];
      this.qcbcDataList.forEach((item,index) => {
          editArr.forEach((item1,index1) => {
            if(index === this.currentQcbcIndex && column.property === item1) {
              item[item1+'Edit'] = true;
            } else {
              item[item1+'Edit'] = false;
            }
          })
      })
      this.qcbcDataList = JSON.parse(JSON.stringify(this.qcbcDataList));
      this.handleInputFocus(column.property,this.currentQcbcIndex)
    },
    addQcbc(){
      // this.qcbcDataList.splice(this.qcbcDataList.length,0,JSON.parse(JSON.stringify(this.qcbcDataList[this.qcbcDataList.length-1])))
      // this.qcbcDataList[this.qcbcDataList.length-1].qcbcseq = Math.max(...(this.qcbcDataList.filter(item => item.qcbcseq).map(item => item.qcbcseq)))+1;
      // this.qcbcDataList[this.qcbcDataList.length-1].qcbc001 = null;
      // this.qcbcDataList[this.qcbcDataList.length-1].qcbc001Edit = true;
      // this.qcbcDataList[this.qcbcDataList.length-1].qcbc002 = null;
      // this.qcbcDataList[this.qcbcDataList.length-1].qcbc005 = null;
      // this.qcbcDataList[this.qcbcDataList.length-1].qcbc006 = null;
      // this.qcbcDataList[this.qcbcDataList.length-1].qcbc007 = null;
      // this.qcbcDataList[this.qcbcDataList.length-1].qcbc009 = null;
      // this.qcbcDataList[this.qcbcDataList.length-1].qcbc011 = null;
      if(!this.formData.qcbadocno){
        this.$message.warning('请先查询/新增数据');
      }
      if(!this.formData.qcba010) {
        this.$message.warning('请先填写料件编号');
      }
      if(!this.formData.qcba009) {
        this.$message.warning('请先填写料件单位');
      }
      let maxSeq = 0;
      if(this.qcbcDataList.length > 0) {
        maxSeq = Math.max(...(this.qcbcDataList.filter(item => item.qcbcseq).map(item => item.qcbcseq))) || 1;
      }
      this.qcbcDataList.push({
        "qcbcdocno": this.formData.qcbadocno,
        "qcbcseq": maxSeq + 1,
        "qcbc001": null,
        "qcbc001Edit": true,
        "qcbc002": null,
        "qcbc002_desc": null,
        "qcbc012": null,
        "qcbc013": null,
        "qcbc003": this.formData.qcba010,
        "qcbc003_desc1": null,
        "qcbc003_desc2": null,
        // "qcbc004": null,
        // "qcbc004_desc": null,
        "qcbc005": null,
        "qcbc005_desc": null,
        "qcbc006": " ",
        "qcbc006_desc": null,
        "qcbc007": null,
        "qcbc008": this.formData.qcba009,
        "qcbc008_desc": null,
        "qcbc009": "0",
        "qcbc010": null,
        "qcbc011": ""
      });
      this.qcbcDataList = JSON.parse(JSON.stringify(this.qcbcDataList));
      this.currentQcbcIndex = this.qcbcDataList.length-1;
    },
    deleteQcbc(_index) {
      this.qcbcDataList.splice(_index,1);
      this.qcbcDataList = JSON.parse(JSON.stringify(this.qcbcDataList))
    },
    editQcbc(row,index) {
      // this.editStus.qcbc = !this.editStus.qcbc;
      row.qcbc001Edit = true;
      this.currentQcbcIndex = index;
      this.qcbcDataList = JSON.parse(JSON.stringify(this.qcbcDataList));
    },
    changeQcbcRowData(row, rIndex,column,close) {
      let editArr = ['qcbc001','qcbc002','qcbc005','qcbc006','qcbc007','qcbc009','qcbc011'];
      let focusProperty;
      let focusIndex;
      this.qcbcDataList.forEach((item,index) => {
        let skipNext = false;
        editArr.forEach((item1,index1) => {
          if(skipNext) {
            skipNext = false;
            return;
          }
          if(rIndex === index && column === item1) {
            if(close) {
              item[item1 + 'Edit'] = false;
              if(index1 < editArr.length-1) {
                skipNext = true;
                item[editArr[index1+1]+'Edit'] = true;
                focusProperty = editArr[index1+1]
                focusIndex = this.currentQcbcIndex
              }
            } else {
              item[item1 + 'Edit'] = true;
            }
          } else {
            item[item1+'Edit'] = false;
          }
        })
      })
      this.qcbcDataList = JSON.parse(JSON.stringify(this.qcbcDataList))
      this.handleInputFocus(focusProperty,focusIndex)
    },

    clickQcbdRow(row, column, e) {
      if(!column) return;
      this.currentQcbdIndex = e.currentTarget.rowIndex;
      if(!this.iedit) return;
      // ['qcbd009','qcbd010','qcbd021','bz'].forEach(pr => {
      //   for (let i = 0; i < this.qcbdDataList.length; i++) {
      //     if(!column.property && i === this.currentQcbdIndex) {
      //       this.qcbdDataList['qcbd009Edit'] = false;
      //     } else {
      //       if(pr !== column.property || i !== this.currentQcbdIndex) {
      //         this.qcbdDataList[i][pr+'Edit'] = false;
      //       }
      //     }
      //   }
      // })
    },
    dbClickQcbdRow(row, column, e) {
      if(!column) return;
      this.currentQcbdIndex = e.currentTarget.rowIndex;
      if(!this.iedit) return;
      // if(['qcbd009','qcbd010','qcbd021','bz'].findIndex(i => i=== column.property) > -1) {
      //   this.qcbdDataList[this.currentQcbdIndex][column.property+'Edit'] = true;
      // } else {
      //   this.qcbdDataList[this.currentQcbdIndex]['qcbd009Edit'] = true;
      // }
      let editArr = ['qcbd009','qcbd010','qcbd021','bz'];
      this.qcbdDataList.forEach((item,index) => {
        editArr.forEach((item1,index1) => {
          if(index === this.currentQcbdIndex && column.property === item1) {
            item[item1+'Edit'] = true;
          } else {
            item[item1+'Edit'] = false;
          }
        })
      })
      this.qcbdDataList = JSON.parse(JSON.stringify(this.qcbdDataList));
      this.handleInputFocus(column.property,this.currentQcbdIndex)
    },
    addQcbd(row,_index){},
    deleteQcbd(row,_index){
      this.qcbdDataList.splice(_index,1);
      this.qcbdDataList = JSON.parse(JSON.stringify(this.qcbdDataList))
    },
    editQcbd(row,index) {
      row.qcbd009Edit = true;
      this.currentQcbdIndex = index;
      this.qcbdDataList[this.currentQcbdIndex].qcbd010Edit = false;
      this.qcbdDataList[this.currentQcbdIndex].qcbd021Edit = false;
      this.qcbdDataList[this.currentQcbdIndex].bzEdit = false;
      this.qcbdDataList = JSON.parse(JSON.stringify(this.qcbdDataList));
      this.handleInputFocus('qcbd009',this.currentQcbdIndex)
    },
    changeQcbdRowData(row, rIndex,column,close) {
      let editArr = ['qcbd009','qcbd010','qcbd021','bz'];
      let refDom;
      let focusProperty;
      let focusIndex;
      this.qcbdDataList.forEach((item,index) => {
        let skipNext = false;
        editArr.forEach((item1,index1) => {
          if(skipNext) {
            skipNext = false;
            return;
          }
          if(rIndex === index && column === item1) {
            if(close) {
              item[item1 + 'Edit'] = false;
              if(index1 < editArr.length-1) {
                skipNext = true;
                item[editArr[index1+1]+'Edit'] = true;
                focusProperty = editArr[index1+1];
                focusIndex = this.currentQcbdIndex;
                // refDom = document.getElementById('ref-' + editArr[index1+1] + '-' + this.currentQcbdIndex);
              }
            } else {
              item[item1 + 'Edit'] = true;
            }
          } else {
            item[item1+'Edit'] = false;
          }
        })
      })
      this.qcbdDataList = JSON.parse(JSON.stringify(this.qcbdDataList))
      this.handleInputFocus(focusProperty,focusIndex)
    },

    clickQcbd2Row(row, column, e) {
      this.currentQcbd2Index = e.currentTarget.rowIndex;
      // this.handleClickTab2({name:'tab-2-2'})
    },

    clickQcbeRow(row, column, e) {
      this.currentQcbeIndex = e.currentTarget.rowIndex;
    },
    dbClickQcbeRow(row, column, e) {
      if(!column) return;
      this.currentQcbeIndex = e.currentTarget.rowIndex;
      if(!this.iedit) return;
      // if(['qcbe001','qcbe002','qcbe004','qcbe003'].findIndex(i => i=== column.property) > -1) {
      //   this.qcbeDataList[this.currentQcbeIndex][column.property+'Edit'] = true;
      // } else {
      //   this.qcbeDataList[this.currentQcbeIndex]['qcbe001Edit'] = true;
      // }
      let editArr = ['qcbe001','qcbe002','qcbe004','qcbe003'];
      this.qcbeDataList.forEach((item,index) => {
        editArr.forEach((item1,index1) => {
          if(index === this.currentQcbeIndex && column.property === item1) {
            item[item1+'Edit'] = true;
          } else {
            item[item1+'Edit'] = false;
          }
        })
      })
      this.qcbeDataList = JSON.parse(JSON.stringify(this.qcbeDataList));
      // let refDom = document.getElementById('ref-' + column.property + "-" + this.currentQcbeIndex);
      this.handleInputFocus(column.property,this.currentQcbeIndex)
    },
    addQcbe(){
      if(!this.formData.qcbadocno){
        this.$message.warning('请先查询数据');
        return;
      }
      if(!this.qcbdDataList[this.currentQcbdIndex||0].qcbdseq){
        this.$message.warning('请先查询数据');
        return;
      }
      this.qcbeDataList.push({
        qcbedocno : this.formData.qcbadocno,
        qcbeseq : this.qcbdDataList[this.currentQcbdIndex||0].qcbdseq,
        qcbe001 : '',
        qcbe001Edit : true,
        qcbe002 : '',
        qcbe004 : '',
        qcbe003 : '',
      })
      this.qcbeDataList = JSON.parse(JSON.stringify(this.qcbeDataList));
      this.currentQcbeIndex = this.qcbeDataList.length-1;
    },
    deleteQcbe(row,_index){
      this.qcbeDataList.splice(_index,1);
      this.qcbeDataList = JSON.parse(JSON.stringify(this.qcbeDataList))
    },
    editQcbe(row,index) {
      row.qcbe001Edit = true;
      this.currentQcbeIndex = index;
      this.qcbeDataList[this.currentQcbeIndex].qcbe001Edit = false;
      this.qcbeDataList = JSON.parse(JSON.stringify(this.qcbeDataList));
      this.handleInputFocus('qcbe001',this.currentQcbeIndex)
    },
    changeQcbeRowData(row, rIndex,column,close) {
      let editArr = ['qcbe001','qcbe002','qcbe004','qcbe003'];
      let refDom;
      let focusProperty;
      let focusIndex;
      this.qcbeDataList.forEach((item,index) => {
        let skipNext = false;
        editArr.forEach((item1,index1) => {
          if(skipNext) {
            skipNext = false;
            return;
          }
          if(rIndex === index && column === item1) {
            if(close) {
              item[item1 + 'Edit'] = false;
              if(index1 < editArr.length-1) {
                skipNext = true;
                item[editArr[index1+1]+'Edit'] = true;
                focusProperty = editArr[index1+1];
                focusIndex = this.currentQcbeIndex;
              }
            } else {
              item[item1 + 'Edit'] = true;
            }
          } else {
            item[item1+'Edit'] = false;
          }
        })
      })
      this.qcbeDataList = JSON.parse(JSON.stringify(this.qcbeDataList))
      this.handleInputFocus(focusProperty,focusIndex)
    },

    translateByOptions(list, val) {
      let item = list.find(l => l.value === val)
      if(item) {
        return item.label;
      } else {
        return val;
      }
    },
    async handleStusClick(command){
      if(command === 'Y') {
        this.formData.qcbastus = 'Y';
        this.stusTxt = '已审核';
      } else if (command === 'N') {
        this.formData.qcbastus = 'N';
        this.stusTxt = '未审核';
      } else if (command === 'X') {
        this.formData.qcbastus = 'X';
        this.stusTxt = '已作废';
      } else if (command === 'clear') {
        this.formData.qcbastus = '';
        this.stusTxt = '';
      } else if (command === 'unConfirmed') {
        await this.unConfirmed();
      } else if (command === 'confirmed') {
        await this.confirmed();
      }
    },

    handleInputFocus(property,index){
      let refDom = document.getElementById('ref-' + property + "-" + index);
      this.$nextTick(() =>{
        if(refDom) {
          let inputDom = refDom.getElementsByTagName("input");
          if(inputDom[0]){
            inputDom[0].focus()
          } else {
            refDom.focus();
          }
        }
      },10)
      // this.$refs['ref-' + column.property + "-" + this.currentQcbcIndex]
      //   document.getElementById('ref-' + column.property + "-" + this.currentQcbcIndex).getElementsByTagName("input")[0].focus()
    },

    // 选中背景色
    tableRowClassName({row, rowIndex}) {
      let color = ['aqct-table-row'];

      let index = this.getCurrentRowIndex();
      if (rowIndex === index) {
        color.push('row-selected')
      }
      return color;
    },
    tableRowClassNameQcbc({row, rowIndex}) {
      let color = ['aqct-table-row','aqct-table-qcbc-row'];
      if (rowIndex === this.currentQcbcIndex) {
        color.push('row-selected')
      }
      return color;
    },
    tableRowClassNameQcbd({row, rowIndex}) {
      let color = ['aqct-table-row'];
      if (rowIndex === this.currentQcbdIndex) {
        color.push('row-selected')
      }
      return color;
    },
    tableRowClassNameQcbd2({row, rowIndex}) {
      let color = ['aqct-table-row'];
      if (rowIndex === this.currentQcbd2Index) {
        color.push('row-selected')
      }
      return color;
    },
    tableRowClassNameQcbe({row, rowIndex}) {
      let color = ['aqct-table-row'];
      if (rowIndex === this.currentQcbeIndex) {
        color.push('row-selected')
      }
      return color;
    },
    getCurrentRowIndex() {
      let index = 0;
      if (this.currentIndex % (this.pageSize) === 0) {
        index = 9;
      } else {
        index = this.currentIndex % (this.pageSize) - 1;
      }
      return index;
    },
    chooseStus(stus,txt) {

    },

    async translateVal2(dataKey,key,newV,isCurrentNew){
      let value;
      let type;
      let text;
      let translateArr;
      if(dataKey === 'formData') {

        translateArr = ['qcba900','qcba901','qcba009','qcba016','qcba024','qcbaownid','qcbaowndp','qcbacrtid','qcbacrtdp','qcbamodid','qcbacnfid'];
        let item = translateArr.find(r => r === key);
        if(item){
          value = this.formData[key];
          if(value !== newV) {
            type = item;
            text = isCurrentNew ? value : newV;
          }
        }
        if(type && text && this.translateLatest[type] !== text) {
          // let resp = aqct300.translate({type:type,text:text});
          // value = resp.msg;
          let r = await aqct300.translate({type:type,text:text})
          this.descSet[type+'_desc'] = r.msg
          console.log("set:"+ type + '_desc =>',r.msg)
        } else {
          this.translateLatest[type] = text || ''
        }
        this.descSet = JSON.parse(JSON.stringify(this.descSet))

      } else if (dataKey === 'qcbc') {

      } else if (dataKey === 'qcbe') {

      }
    }

  }
}

</script>
<style scoped>
.aqct300-table {
  margin: 10px;
  font-size: 13px;
  /*top:0px;*/
  /*position: relative;*/
  /*width: 100%;*/
}
.aqct300-table .aqct300-form{
  margin-bottom: 40px;
}

.aqct300-table >>> .el-form-item__label {
  font-size: 12px;
}

.aqct300-table >>> .el-input--suffix .el-input__inner {
  /*padding-left: 5px;*/
  /*padding-right: 5px;*/
}

.aqct300-table .el-col .el-col {
  height: 30px;
  font-size: 13px;
}

.aqct300-table .op-area {
  width: 100%;
  height: 38px;
  background-color: white;
  /*z-index: 100;*/
}

.aqct300-table .op-area .btn-area {
  float: right;
  margin-right: 20px;
  background-color: white;
}

.aqct300-table .area-1 {
  border: 1px solid #dcdcdc;
  padding: 10px;
}

.aqct300-table .area-2 {
  border: 1px solid #dcdcdc;
  padding: 10px;
  margin-top: 10px;
  min-height: 480px;
  /*max-height: 500px;*/
}

.aqct300-table .area-3 {
  border: 1px solid #dcdcdc;
  padding: 10px;
  margin-top: 10px;
}

.aqct300-table .tab-1-1-1, .aqct300-table .tab-1-1-2 {
  border: 1px solid #dcdcdc;
  padding: 10px;
  height: 262px;
}

.aqct300-table .tab-1-1-3, .aqct300-table .tab-1-1-4 {
  border: 1px solid #dcdcdc;
  padding: 10px;
  margin-top: 10px;
  height: 115px;
}

.aqct300-table .tab-2-1, .aqct300-table .tab-2-2, .aqct300-table .tab-2-3, .aqct300-table .tab-2-4 {
  border: 1px solid #dcdcdc;
  padding: 10px;
  /*margin-top: 10px;*/
  /*height: 215px;*/
}

.aqct300-table .list-area {

}

.aqct300-table .list-area >>> .el-drawer__body {
  padding: 15px;
}

.aqct300-table .is-disabled, .aqct300-table .is-disabled >>> input {
  background-color: #e3e3e3 !important;
  color: black
  /*color:red !important;*/
}

/*.footer{*/
/*  position: fixed;*/
/*  bottom: 0;*/
/*  width: 100%;*/
/*  height: 30px;*/
/*  background-color: red;*/
/*}*/
.page-bottom {
  /*padding-right: 20px;*/
  bottom: 0px;
  position: fixed;
  background: white;
  width: 100%;
}

.el-table >>> .row-selected > td {
  background-color: #F8ECDA !important;
  /*color:red;*/
}
.aqct-table-row td {
  min-height: 43px !important;
}

.aqct-table-row td .cell .el-select >>> input {
  max-height: 28px !important;
  margin:0;
}
.aqct-table-row td .cell .search-item >>> input {
  max-height: 26px !important;
}
.aqct-table-row td .cell .el-input >>> input {
  max-height: 25px !important;
}
.qcbc-op-area{
  /*font-size:24px!important;*/
  /*height: 24px!important;*/
}
.table-button{
  float: right;
  top:-8px;
  position: relative;
}
.desc-span {
  position: absolute;
  text-align: center;
  height: 25px;
  color: rgb(0, 130, 153);
  bottom: 0px;
  font-size: 12px;
}
.el-table >>> .cell {
  line-height: 20px!important;
}
.search-item >>> .c-input input {
  padding-left: 10px!important;
  padding-right: 3px!important;
}
.el-input >>> input {
  padding-left: 10px!important;
  padding-right: 3px!important;
}
.el-select >>> input {
  padding-left: 10px!important;
  padding-right: 3px!important;
}
</style>

<style>
.aqct300-table .el-select .is-disabled input {
  background-color: #e3e3e3 !important;
  color: black
  /*color:red !important;*/
}
</style>
